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 Summary
Fields inherited from class org.eclipse.draw2d.AbstractBorder
tempRect
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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 Summary
Modifier and TypeMethodDescriptiongetColor()
Returns the line color of this border.Returns the space used by the border for the figure provided as input.int
getStyle()
Returns the line style for this border.int
getWidth()
Returns the line width of this border.boolean
isOpaque()
Returnstrue
since this border is opaque.void
Paints the border.void
Sets the line color for this border.void
setStyle
(int style) Sets the line type of this border.void
setWidth
(int width) Sets the line width for this border.Methods inherited from class org.eclipse.draw2d.AbstractBorder
getPaintRectangle, getPreferredSize
-
Constructor Details
-
LineBorder
Constructs 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, seeGraphics
- Since:
- 3.5
-
LineBorder
Constructs 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
-
LineBorder
Constructs a LineBorder with the specified color and a width of 1 pixel.- Parameters:
color
- The color of the border.- Since:
- 2.0
-
LineBorder
public LineBorder(int width) Constructs a black LineBorder with the specified width.- Parameters:
width
- The width of the border in pixels.- Since:
- 2.0
-
LineBorder
public LineBorder()Constructs a default black LineBorder with a width of one pixel.- Since:
- 2.0
-
-
Method Details
-
getColor
Returns the line color of this border.- Returns:
- The line color of this border
-
getInsets
Returns 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
-
getWidth
public int getWidth()Returns the line width of this border.- Returns:
- The line width of this border
-
isOpaque
public boolean isOpaque()Returnstrue
since this border is opaque. Being opaque it is responsible to fill in the area within its boundaries.- Specified by:
isOpaque
in interfaceBorder
- Overrides:
isOpaque
in classAbstractBorder
- Returns:
true
since this border is opaque- See Also:
-
paint
Description copied from interface:Border
Paints 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 tographics
- The graphics object used for paintinginsets
- The insets- See Also:
-
setColor
Sets the line color for this border.- Parameters:
color
- The line color
-
setWidth
public void setWidth(int width) Sets the line width for this border.- Parameters:
width
- The line width
-
getStyle
public int getStyle()Returns the line style for this border.- Returns:
- The line style for this border
- Since:
- 3.5
-
setStyle
public void setStyle(int style) Sets the line type of this border.- Parameters:
style
- For the list of valid values, seeGraphics
- Since:
- 3.5
-