Package org.eclipse.draw2d
Class LineBorder
java.lang.Object
org.eclipse.draw2d.AbstractBorder
org.eclipse.draw2d.LineBorder
- All Implemented Interfaces:
- Border
Provides for a line border with sides of equal widths.
- 
Field SummaryFields inherited from class org.eclipse.draw2d.AbstractBordertempRect
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a default black LineBorder with a width of one pixel.LineBorder(int width) Constructs a black LineBorder with the specified width.LineBorder(Color color) Constructs a LineBorder with the specified color and a width of 1 pixel.LineBorder(Color color, int width) Constructs a LineBorder with the specified color and of the specified width.LineBorder(Color color, int width, int style) Constructs a LineBorder with the specified color and of the specified width and style.
- 
Method SummaryModifier and TypeMethodDescriptiongetColor()Returns the line color of this border.Returns the space used by the border for the figure provided as input.intgetStyle()Returns the line style for this border.intgetWidth()Returns the line width of this border.booleanisOpaque()Returnstruesince this border is opaque.voidPaints the border.voidSets the line color for this border.voidsetStyle(int style) Sets the line type of this border.voidsetWidth(int width) Sets the line width for this border.Methods inherited from class org.eclipse.draw2d.AbstractBordergetPaintRectangle, getPreferredSize
- 
Constructor Details- 
LineBorderConstructs a LineBorder with the specified color and of the specified width and style.- Parameters:
- color- The color of the border.
- width- The width of the border in pixels.
- style- The style of the border. For the list of valid values, see- Graphics
- Since:
- 3.5
 
- 
LineBorderConstructs a LineBorder with the specified color and of the specified width.- Parameters:
- color- The color of the border.
- width- The width of the border in pixels.
- Since:
- 2.0
 
- 
LineBorderConstructs a LineBorder with the specified color and a width of 1 pixel.- Parameters:
- color- The color of the border.
- Since:
- 2.0
 
- 
LineBorderpublic LineBorder(int width) Constructs a black LineBorder with the specified width.- Parameters:
- width- The width of the border in pixels.
- Since:
- 2.0
 
- 
LineBorderpublic LineBorder()Constructs a default black LineBorder with a width of one pixel.- Since:
- 2.0
 
 
- 
- 
Method Details- 
getColorReturns the line color of this border.- Returns:
- The line color of this border
 
- 
getInsetsReturns the space used by the border for the figure provided as input. In this border all sides always have equal width.- Parameters:
- figure- The figure this border belongs to
- Returns:
- This border's insets
 
- 
getWidthpublic int getWidth()Returns the line width of this border.- Returns:
- The line width of this border
 
- 
isOpaquepublic boolean isOpaque()Returnstruesince this border is opaque. Being opaque it is responsible to fill in the area within its boundaries.- Specified by:
- isOpaquein interface- Border
- Overrides:
- isOpaquein class- AbstractBorder
- Returns:
- truesince this border is opaque
- See Also:
 
- 
paintDescription copied from interface:BorderPaints the border. The border should paint inside figure'sIFigure.getBounds(), inset by the parameter insets. The border generally should not paint inside its own insets. More specifically, Border b should paint inside the rectangle: figure.getBounds().getCropped(insets) and outside of the rectangle: figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is defined asRectangle.contains(int, int).- Parameters:
- figure- The figure this border belongs to
- graphics- The graphics object used for painting
- insets- The insets
- See Also:
 
- 
setColorSets the line color for this border.- Parameters:
- color- The line color
 
- 
setWidthpublic void setWidth(int width) Sets the line width for this border.- Parameters:
- width- The line width
 
- 
getStylepublic int getStyle()Returns the line style for this border.- Returns:
- The line style for this border
- Since:
- 3.5
 
- 
setStylepublic void setStyle(int style) Sets the line type of this border.- Parameters:
- style- For the list of valid values, see- Graphics
- Since:
- 3.5
 
 
-