org.rubato.composer.rubette
Class Connector
java.lang.Object
org.rubato.composer.rubette.Connector
public class Connector
- extends java.lang.Object
Connectors are the the little boxes on rubettes where links
come in and go out.
There are two types of connectors: input and output.
Each connector can be in one of two states, namely
connected or unconnected, which is indicated by the
use of different colors.
- Author:
- Gérard Milmeister
Constructor Summary |
Connector(JRubette jrubette,
int pos,
java.awt.Rectangle r,
int state,
int type)
Creates a new connector. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CONNECTED
public static final int CONNECTED
- See Also:
- Constant Field Values
UNCONNECTED
public static final int UNCONNECTED
- See Also:
- Constant Field Values
INPUT
public static final int INPUT
- See Also:
- Constant Field Values
OUTPUT
public static final int OUTPUT
- See Also:
- Constant Field Values
stateString
public static final java.lang.String[] stateString
Connector
public Connector(JRubette jrubette,
int pos,
java.awt.Rectangle r,
int state,
int type)
- Creates a new connector.
- Parameters:
jrubette
- the rubette this connector is part ofpos
- the position of the connector (1..8)r
- the size of the connectorstate
- the initial state of the connectortype
- the type of the connector
getJRubette
public JRubette getJRubette()
getPos
public int getPos()
getState
public int getState()
getType
public int getType()
setState
public void setState(int state)
getLinkCount
public int getLinkCount()
getLink
public JLink getLink(int i)
addLink
public boolean addLink(JLink link)
- Adds a new link to the connector.
The start of end position of the link is set
according to the type of the connector.
setLink
public boolean setLink(JLink link)
removeLink
public void removeLink(JLink link)
getLinks
public java.util.List<JLink> getLinks()
getConnectPoint
public java.awt.Point getConnectPoint()
contains
public boolean contains(int x,
int y)
setRectangle
public void setRectangle(java.awt.Rectangle r)
paint
public void paint(java.awt.Graphics2D g)
refresh
public void refresh()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object