|
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(java.util.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. |
protected NodeRealizer |
createConfiguredAdapter(NodeRealizer prototype,
NodePort port)
Creates the NodeRealizer adapter instance for
GenericNodeRealizer behavior implementations used by this
class. |
boolean |
findIntersection(NodePort port,
double ix,
double iy,
double ox,
double oy,
java.awt.geom.Point2D result)
Returns true if the point (ix,iy) lies inside
and the point (ox,oy) lies outside the specified port
and false< otherwise. |
java.awt.Color |
getFillColor()
Returns the main color that is used to fill the interior of NodePort s. |
java.awt.Color |
getFillColor2()
Returns the gradient color that is used to fill the interior of NodePort s. |
java.awt.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,
java.awt.Graphics2D g)
Paints the specified port. |
void |
setFillColor(java.awt.Color fillColor)
Specifies the main color that is used to fill the interior of NodePort s. |
void |
setFillColor2(java.awt.Color fillColor2)
Specifies the gradient color that is used to fill the interior of NodePort s. |
void |
setLineColor(java.awt.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(java.util.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)
true
if the specified port contains the specified
point and false
otherwise.
Delegates to the GenericNodeRealizer.ContainsTest
implementation associated to this class.
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.createConfiguredAdapter(NodeRealizer, NodePort)
public void paint(NodePort port, java.awt.Graphics2D g)
Delegates to the GenericNodeRealizer.Painter
implementation associated to this class.
paint
in interface NodePort.Painter
port
- the port instance to paint.g
- the graphics context to paint upon.createConfiguredAdapter(NodeRealizer, NodePort)
public boolean findIntersection(NodePort port, double ix, double iy, double ox, double oy, java.awt.geom.Point2D result)
true
if the point (ix,iy)
lies inside
and the point (ox,oy)
lies outside the specified port
and false<
otherwise.
Delegates to the GenericNodeRealizer.IntersectionTest
implementation associated to this class.
findIntersection
in interface NodePort.IntersectionTest
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.
true
if (ix,iy)
lies inside and
(ox,oy)
lies outside the specified port and
false<
otherwise.createConfiguredAdapter(NodeRealizer, NodePort)
public java.awt.Color getFillColor()
NodePort
s.
NodePort
s.setFillColor(java.awt.Color)
,
getFillColor2()
,
setFillColor2(java.awt.Color)
public void setFillColor(java.awt.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 java.awt.Color getFillColor2()
NodePort
s.
NodePort
s.setFillColor2(java.awt.Color)
,
getFillColor()
,
setFillColor(java.awt.Color)
public void setFillColor2(java.awt.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 java.awt.Color getLineColor()
NodePort
s.
NodePort
s.setLineColor(java.awt.Color)
public void setLineColor(java.awt.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()
protected NodeRealizer createConfiguredAdapter(NodeRealizer prototype, NodePort port)
NodeRealizer
adapter instance for
GenericNodeRealizer
behavior implementations used by this
class.
The default implementation creates a GenericNodeRealizer
copy of the specified prototype realizer and adopts the port's bounds
as well as the port's selection state.
Called from contains(NodePort, double, double)
,
findIntersection(NodePort, double, double, double, double, java.awt.geom.Point2D)
,
and paint(NodePort, java.awt.Graphics2D)
.
prototype
- a GenericNodeRealizer
instanceport
- the NodePort
instance that is represented
by the created NodeRealizer
instance.
GenericNodeRealizer
that represents the
specified NodePort
instance.contains(NodePort, double, double)
,
findIntersection(NodePort, double, double, double, double, java.awt.geom.Point2D)
,
paint(NodePort, java.awt.Graphics2D)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |