Sets the members of Rectangle to the specified values. 我们没有为‘Welcome'提供任何LargeRectangle 。 We don't have any Large Rectangle for‘Welcome'. 现在你可以通过简单的名字来引用Rectangle 类。 我们没有为‘Podcast'提供任何LargeRectangle 。 We don't have any Large Rectangle for‘Podcast'.
P-一个Point,它是Rectangle 的左上顶点. P- a point, the top-left corner of the rectangle . 每个Rectangle 类的完全限定名称包括包名称。 The fully qualified name of each Rectangle class includes the package name. There is given another example that maintains the records of Rectangle class. 例如,如果一个形状的Name属性值为“Rectangle 2”,则. For example, if the value of the Name property for a shape is Rectangle 2. The y property is used to increase the vertical dimension of the Rectangle object. DrawImage方法的一种变体接收Bitmap对象和Rectangle 对象。 One variation of the DrawImage method receives a Bitmap and a Rectangle . 更改Rectangle 对象的top属性对x和width属性没有影响。 Changing the top property of a Rectangle object has no effect on the x and width properties. 在上面的示例中,Square类使用extends关键字从Rectangle 继承。 In the above example the Square class inherits from Rectangle using the extends keyword. 更改Rectangle 对象的width值对x、y和height属性没有影响。 Changing the width value of a Rectangle object has no effect on the x, y, and height properties. 如果为h和v提供负值,则Rectangle 的大小也将相应地缩小。 If negative values are supplied for h and v, the size of the rectangle decreases accordingly.更改Rectangle 对象的height值对x、y和width属性没有影响。 Changing the height value of a Rectangle object has no effect on the x, y, and width properties. 基本Artist表示我们在图形中能看到的一类对象,如Line2D、Rectangle 、Circle与Text。 Primitive artists represent the kinds of objects you see in a plot: Line2D, Rectangle , Circle, and Text. 我们的示例类Rectangle 包含三个成员函数:AcceptDetails,GetArea和Display。 Our sample class Rectangle contains three member functions: AcceptDetails, GetArea and Display. 示例5-12:增加注解来派生Debugtrait,并使用调试格式打印Rectangle 实例. Listing 5-12: Adding the annotation to derive the Debug trait and printing the Rectangle instance using debug formatting. 在我们的样本类Rectangle 包含三个成员函数:AcceptDetails,GetArea和Display. Our sample class Rectangle contains three member functions: AcceptDetails, GetArea and Display. 它将向AbstractFactory传递形状信息Shape(CIRCLE/RECTANGLE /SQUARE),以便获取它所需对象的类型。 It will pass information to ShapeFactory(CIRCLE/ RECTANGLE / SQUARE) to get the type of object it needs. 更改Rectangle 对象的x属性的值对y、width和height属性没有影响。 Changing the value of the x property of a Rectangle object has no effect on the y, width, and height properties. 现在让我们看看如何继续重构这些代码,来将area函数协调进Rectangle 类型定义的area方法中。 Let's look at how we can continue to refactor this code by turning the area function into an area methoddefined on our Rectangle type. 为了使函数定义于Rectangle 的上下文中,我们开始了一个impl块(impl是implementation的缩写)。 To define the function within the context of Rectangle , we start an impl(implementation) block. 它将向AbstractFactory传递形状信息Shape(CIRCLE/RECTANGLE /SQUARE),以便获取它所需对象的类型。 It will pass the shape information Shape(CIRCLE/ RECTANGLE / SQUARE) to AbstractFactory to get the type of object it needs. Copy来复制一个Rectangle,你会发现它仅仅复制了Rectangle 对象,但没有复制嵌套的Point对象。 Copy to duplicate a Rectangle, you will nd that it copies the Rectangle object but not the embedded Point. 函数area现在被定义为接收一个名叫rectangle 的参数,其类型是一个结构体Rectangle 实例的不可变借用。 Our area function is now defined with one parameter, which we have named rectangle , whose type is an immutable borrow of a struct Rectangle instance. 此方法检查指定的Rectangle 对象的x、y、width和height属性,以查看它是否与此Rectangle 对象相交。 This method checks the x, y, width, and height properties of the specified Rectangle object to see if it intersects with this Rectangle object.
展示更多例子
结果: 28 ,
时间: 0.0179
English
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt