public class P2DFrame extends java.lang.Object implements P2DFrameInterface
Modifier and Type | Field and Description |
---|---|
protected int |
armedHandle |
static float |
handleSize
The handle size in pixel.
|
static java.lang.String |
version |
Constructor and Description |
---|
P2DFrame()
The constructor.
|
P2DFrame(java.awt.Color c)
Constructor that receives the color of the frame.
|
P2DFrame(FwkAppearanceInterface ap)
Constructor that receives the appearance of the frame.
|
P2DFrame(P2DFrameInterface source)
A constructor receiving another frame.
|
Modifier and Type | Method and Description |
---|---|
void |
allHandles()
Order all handles.
|
FwkAppearanceInterface |
getAppearance()
Get the appearance of the frame.
|
int |
getArmedHandle()
Returns the last calculated the armed handle.
|
int |
getArmedHandle(java.awt.geom.Point2D ap)
Calculate the armed handle for the given point.
|
P2DBoundingBoxInterface |
getBoundingBox()
Retrieve the bounding box the component.
|
java.awt.Color |
getColor()
Gets the background color.
|
float[] |
getDashArray()
Returns the array representing the lengths of the
dash segments.
|
float |
getDashPhase()
Returns the current dash phase.
|
int |
getEndCap()
Returns the end cap style.
|
boolean |
getHandle(int index)
Retrieves the handle at the specified position.
|
boolean |
getHandlesVisible()
Returns a boolean whether the handles are visible.
|
int |
getLineJoin()
Returns the line join style.
|
boolean |
getLinesVisible()
Returns a boolean whether the handles are visible.
|
float |
getLineWidth()
Returns the line width.
|
float |
getMiterLimit()
Returns the limit of miter joins.
|
java.awt.Stroke |
getStroke()
Gets the Stroke for the Graphics2D context.
|
float |
getTransparency()
Gets the transparency of the background.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
boolean |
getVisible()
Get the frame visibility.
|
boolean |
hasHandles()
Returns a boolean whether the frame has handles.
|
void |
hideHandles()
Hide all the handles.
|
void |
hideLines()
Hide the lines.
|
boolean |
isVisible()
Get the visibility.
|
void |
noHandles()
Order no handles.
|
void |
paint(java.awt.Graphics2D g)
Paint the frame.
|
void |
release()
Release the object.
|
void |
resetArmedHandle()
Reset the active handle.
|
void |
setAppearance(FwkAppearanceInterface appearance)
Set the appearance of the frame.
|
void |
setArmedHandle(int index)
Sets the armed handle.
|
void |
setBoundingBox(P2DBoundingBoxInterface bb)
Set the the bounding box of the component.
|
void |
setColor(java.awt.Color color)
Sets the background color.
|
void |
setDashArray(float[] arr)
Sets the array representing the lengths of the
dash segments.
|
void |
setDashPhase(float phase)
Sets the current dash phase.
|
void |
setEndCap(int cap)
Retrieves the end cap style.
|
void |
setHandle(int index,
boolean flag)
Set the handle at the specified position.
|
void |
setHandlesVisible(boolean flag)
Set the handle visibility.
|
void |
setLineJoin(int join)
Retrieves the line join style.
|
void |
setLinesVisible(boolean flag)
Set the line visiblility.
|
void |
setLineWidth(float w)
Sets the line width of the stroke.
|
void |
setMiterLimit(float limit)
Retrieves the limit of miter joins.
|
void |
setStroke(java.awt.Stroke s)
Sets the Stroke for the Graphics2D context.
|
void |
setTransparency(float transparency)
Sets the transparency of the background.
|
void |
setVisible(boolean flag)
Set the frame visibility.
|
void |
showHandles()
Show all handles.
|
void |
showLines()
Show lines.
|
void |
updateGeometry()
Update the geometry.
|
public static final java.lang.String version
public static final float handleSize
protected int armedHandle
public P2DFrame()
public P2DFrame(java.awt.Color c)
c
- The color of the background.public P2DFrame(FwkAppearanceInterface ap)
ap
- The appearance of the background.public P2DFrame(P2DFrameInterface source)
source
- the source frame.public java.lang.String getVersion()
FwkInterface
getVersion
in interface FwkInterface
public void release()
release
in interface FwkInterface
public void paint(java.awt.Graphics2D g)
paint
in interface P2DFrameInterface
g
- The graphical context.public void updateGeometry()
updateGeometry
in interface P2DFrameInterface
public FwkAppearanceInterface getAppearance()
getAppearance
in interface P2DFrameInterface
public void setAppearance(FwkAppearanceInterface appearance)
setAppearance
in interface P2DFrameInterface
appearance
- The appearance of the frame.public boolean isVisible()
isVisible
in interface P2DFrameInterface
public void setVisible(boolean flag)
setVisible
in interface P2DFrameInterface
flag
- true if the frame should be visible.public boolean getVisible()
getVisible
in interface P2DFrameInterface
public P2DBoundingBoxInterface getBoundingBox()
getBoundingBox
in interface P2DFrameInterface
public void setBoundingBox(P2DBoundingBoxInterface bb)
setBoundingBox
in interface P2DFrameInterface
bb
- The new bounding box of the component.public boolean hasHandles()
hasHandles
in interface P2DFrameInterface
public void noHandles()
noHandles
in interface P2DFrameInterface
public void allHandles()
allHandles
in interface P2DFrameInterface
public void setHandle(int index, boolean flag)
0 - 1 - 2
3 - 4 - 5
6 - 7 - 8
setHandle
in interface P2DFrameInterface
index
- The index of the handles to be set.flag
- true if the flag should be enabled.P2DFrameInterface.getHandle(int)
public boolean getHandle(int index)
0 - 1 - 2
3 - 4 - 5
6 - 7 - 8
getHandle
in interface P2DFrameInterface
index
- The index of the handles to be set.setHandle(int, boolean)
public void setHandlesVisible(boolean flag)
setHandlesVisible
in interface P2DFrameInterface
flag
- true if the handle should be visible.public void hideHandles()
hideHandles
in interface P2DFrameInterface
public void showHandles()
showHandles
in interface P2DFrameInterface
public boolean getHandlesVisible()
getHandlesVisible
in interface P2DFrameInterface
public void setLinesVisible(boolean flag)
setLinesVisible
in interface P2DFrameInterface
flag
- true if the frame lines are visible.public void hideLines()
hideLines
in interface P2DFrameInterface
public void showLines()
showLines
in interface P2DFrameInterface
public boolean getLinesVisible()
getLinesVisible
in interface P2DFrameInterface
public void setColor(java.awt.Color color)
setColor
in interface P2DFrameInterface
P2DShape
public java.awt.Color getColor()
getColor
in interface P2DFrameInterface
com.highqsoft.P2D.P2DShape
public void setTransparency(float transparency)
setTransparency
in interface P2DFrameInterface
transparency
- The new transparency value.public float getTransparency()
getTransparency
in interface P2DFrameInterface
public void setLineWidth(float w)
setLineWidth
in interface P2DFrameInterface
w
- The line width.BasicStroke
public float getLineWidth()
getLineWidth
in interface P2DFrameInterface
BasicStroke
public void setDashArray(float[] arr)
setDashArray
in interface P2DFrameInterface
arr
- The segment array.BasicStroke
public float[] getDashArray()
getDashArray
in interface P2DFrameInterface
BasicStroke
public void setDashPhase(float phase)
setDashPhase
in interface P2DFrameInterface
phase
- the dash phase.BasicStroke
public float getDashPhase()
getDashPhase
in interface P2DFrameInterface
BasicStroke
public void setEndCap(int cap)
setEndCap
in interface P2DFrameInterface
BasicStroke
public int getEndCap()
getEndCap
in interface P2DFrameInterface
BasicStroke
public void setLineJoin(int join)
setLineJoin
in interface P2DFrameInterface
join
- the line join style.BasicStroke
public int getLineJoin()
getLineJoin
in interface P2DFrameInterface
BasicStroke
public void setMiterLimit(float limit)
setMiterLimit
in interface P2DFrameInterface
limit
- the limit.BasicStroke
public float getMiterLimit()
getMiterLimit
in interface P2DFrameInterface
BasicStroke
public void setStroke(java.awt.Stroke s)
setStroke
in interface P2DFrameInterface
s
- The Stroke style.Stroke
public java.awt.Stroke getStroke()
getStroke
in interface P2DFrameInterface
Stroke
public int getArmedHandle()
getArmedHandle
in interface P2DFrameInterface
public int getArmedHandle(java.awt.geom.Point2D ap)
getArmedHandle
in interface P2DFrameInterface
p
- The point for that the active handle should be calculated.public void resetArmedHandle()
resetArmedHandle
in interface P2DFrameInterface
public void setArmedHandle(int index)
setArmedHandle
in interface P2DFrameInterface
index
- The index of the active handle.
It returns -1, if no handle could be activated.