|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.PortConfigurationAdapter
public class PortConfigurationAdapter
An adapter class that allows existing implementations of
GenericNodeRealizer.Painter
,
GenericNodeRealizer.IntersectionTest
, and
GenericNodeRealizer.ContainsTest
to be reused in
NodePort
configurations.
Constructor Summary | |
---|---|
PortConfigurationAdapter(Map implementations)
Initializes a new PortConfigurationAdapter instance. |
Method Summary | |
---|---|
boolean |
contains(NodePort port,
double x,
double y)
Returns true if the specified port contains the specified
point and false otherwise. |
boolean |
findIntersection(NodePort port,
double ix,
double iy,
double ox,
double oy,
Point2D result)
Returns true |
Color |
getFillColor()
Returns the main color that is used to fill the interior of NodePort s. |
Color |
getFillColor2()
Returns the gradient color that is used to fill the interior of NodePort s. |
Color |
getLineColor()
Returns the color that is used to draw the border of NodePort s. |
LineType |
getLineType()
Returns the line type that is used to draw the border of NodePort s. |
boolean |
isPortSelectionAware()
Determines whether or not the NodePort selection state
should be taken into account when delegating painting to the adopted
GenericNodeRealizer.Painter implementation. |
void |
paint(NodePort port,
Graphics2D g)
Paints the specified port. |
void |
setFillColor(Color fillColor)
Specifies the main color that is used to fill the interior of NodePort s. |
void |
setFillColor2(Color fillColor2)
Specifies the gradient color that is used to fill the interior of NodePort s. |
void |
setLineColor(Color lineColor)
Specifies the color that is used to draw the border of NodePort s. |
void |
setLineType(LineType lineType)
Specifies the line type that is used to draw the border of NodePort s. |
void |
setPortSelectionAware(boolean aware)
Specifies whether or not the NodePort selection state
should be taken into account when delegating painting to the adopted
GenericNodeRealizer.Painter implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortConfigurationAdapter(Map implementations)
PortConfigurationAdapter
instance.
implementations
- interface implementations for
GenericNodeRealizer.Painter
,
GenericNodeRealizer.IntersectionTest
, and/or
GenericNodeRealizer.ContainsTest
.Method Detail |
---|
public boolean isPortSelectionAware()
NodePort
selection state
should be taken into account when delegating painting to the adopted
GenericNodeRealizer.Painter
implementation.
true
if the NodePort
selection state
is taken into account for painting and false
otherwise.setPortSelectionAware(boolean)
public void setPortSelectionAware(boolean aware)
NodePort
selection state
should be taken into account when delegating painting to the adopted
GenericNodeRealizer.Painter
implementation.
aware
- if true
, the NodePort
selection
state is taken into account for painting; otherwise it is not.isPortSelectionAware()
public boolean contains(NodePort port, double x, double y)
NodePort.ContainsTest
true
if the specified port contains the specified
point and false
otherwise.
Callback method for NodePort.contains(double, double)
.
contains
in interface NodePort.ContainsTest
port
- the port instance to check.x
- the x-coordinate of the point to check.y
- the y-coordinate of the point to check.
true
if the specified port contains the specified
point and false
otherwise.public void paint(NodePort port, Graphics2D g)
NodePort.Painter
Callback method for NodePort.paint(java.awt.Graphics2D)
.
paint
in interface NodePort.Painter
port
- the port instance to paint.g
- the graphics context to paint upon.public boolean findIntersection(NodePort port, double ix, double iy, double ox, double oy, Point2D result)
NodePort.IntersectionTest
true if the point i=(ix,iy)
lies inside
and the point o=(ox,oy)
lies outside the specified port
and false<
otherwise.
Callback method for
NodePort.findIntersection(double, double, double, double, java.awt.geom.Point2D)
.
- Specified by:
findIntersection
in interface NodePort.IntersectionTest
- Parameters:
port
- the port instance to check.ix
- the x-coordinate of the point that has to lie inside the port.iy
- the y-coordinate of the point that has to lie inside the port.ox
- the x-coordinate of the point that has to lie outside the port.oy
- the y-coordinate of the point that has to lie outside the port.result
- an output parameter to store the intersection of the line
segment through i
and o
and the port.
If this method returns false
, the value of this parameter is
undefined.
- Returns:
true if (ix,iy)
lies inside and
(ox,oy)
lies outside the specified port and
false<
otherwise.
public Color getFillColor()
NodePort
s.
NodePort
s.setFillColor(java.awt.Color)
,
getFillColor2()
,
setFillColor2(java.awt.Color)
public void setFillColor(Color fillColor)
NodePort
s.
fillColor
- the main color that is used to fill the interior of
NodePort
s.getFillColor()
,
getFillColor2()
,
setFillColor2(java.awt.Color)
public Color getFillColor2()
NodePort
s.
NodePort
s.setFillColor2(java.awt.Color)
,
getFillColor()
,
setFillColor(java.awt.Color)
public void setFillColor2(Color fillColor2)
NodePort
s.
fillColor2
- the gradient color that is used to fill the interior of
NodePort
s.getFillColor2()
,
getFillColor()
,
setFillColor(java.awt.Color)
public Color getLineColor()
NodePort
s.
NodePort
s.setLineColor(java.awt.Color)
public void setLineColor(Color lineColor)
NodePort
s.
lineColor
- the color that is used to draw the border of
NodePort
s.getLineColor()
public LineType getLineType()
NodePort
s.
NodePort
s.setLineType(LineType)
public void setLineType(LineType lineType)
NodePort
s.
lineType
- the line type that is used to draw the border of
NodePort
s.getLineType()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |