|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zfqjava.chart.AbstractNode
com.zfqjava.chart.Chart
public class Chart
Chart provides a chart container.
| Field Summary | |
|---|---|
protected EventListenerList |
listenerList
|
| Constructor Summary | |
|---|---|
Chart()
|
|
| Method Summary | |
|---|---|
void |
addChartListener(ChartListener l)
Adds the specified chart listener to receive node events from this chart container. |
void |
addGroupListener(GroupListener l)
Adds the specified group listener to receive node events from this chart container. |
void |
addLinkListener(LinkListener l)
Adds the specified link listener to receive link events from this chart. |
void |
addSelection(List nodes)
Adds the nodes to selection. |
void |
addSelection(Node node)
Adds the node to selection. |
void |
addSelectionListener(SelectionListener l)
Adds the specified selection listener to receive node events from this chart container. |
void |
cancelEditing()
Cancels the current editing session. |
void |
clearSelection()
Clears the all selection node. |
protected AbstractCellEditor |
createEditor()
|
protected Shape |
createPaintShape()
Creates the paint shape. |
protected AbstractCellRenderer |
createRenderer()
|
void |
doLayout()
Layout the children nodes. |
protected void |
drawShape(Graphics2D g,
Shape s)
|
Node |
findNodeAt(int x,
int y)
Finds the node contains the point x, y. |
protected void |
fireNodeAdded(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeGrouped(GroupNode node,
List nodeList)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeLinked(Link link,
Node startNode,
Node endNode)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeMoved(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeRemoved(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeResized(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeRotated(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeSelected(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeUngrouped(GroupNode node,
List nodeList)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeUnlinked(Link link,
Node startNode,
Node endNode)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireNodeUnselected(Node node)
Notifies all listeners that have registered interest for notification on this event type. |
ChartListener[] |
getChartListeners()
Returns an array of all the chart listeners registered on this chart. |
JComponent |
getContainer()
Returns the container for this chart. |
Node |
getEditingNode()
Returns the current editing node. |
AbstractCellEditor |
getEditor()
|
Component |
getEditorComponent()
Returns the component that is handling the editing session. |
int |
getGridHeight()
Returns the grid height. |
GridMode |
getGridMode()
Returns the grid mode for this chart. |
int |
getGridWidth()
Returns the grid width. |
List |
getGroupList()
Returns all group nodes. |
GroupListener[] |
getGroupListeners()
Returns an array of all the group listeners registered on this chart. |
LinkListener[] |
getLinkListeners()
Returns an array of all the link listeners registered on this chart. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners
upon this model. |
Dimension |
getPreferredSize()
Returns the preferred size of this node. |
AbstractCellRenderer |
getRenderer()
|
Map |
getRenderingHints()
Returns the RenderingHints for rendering. |
Node |
getSelectedNode()
Returns the last selected node. |
int |
getSelectionCount()
Returns the number of nodes that are selected. |
List |
getSelectionList()
Returns all selected nodes. |
SelectionListener[] |
getSelectionListeners()
Returns an array of all the selection listeners registered on this chart. |
Tool |
getTool()
Returns the Tool for this chart. |
boolean |
group(List nodes)
Group the nodes. |
boolean |
isEditing()
Returns true if a node is being edited. |
boolean |
isGridShown()
Returns the grid shown property. |
boolean |
isGridSnaped()
Returns the grid snaped property. |
boolean |
isGrouped(Node node)
Determines the node grouped state. |
boolean |
isSelected(Node node)
Determines the node selected state. |
boolean |
isSelectionEmpty()
Determines the selection whether is empty. |
void |
moveToBack(Node node)
Move the node to back. |
void |
moveToFront(Node node)
Move the node to front. |
void |
paint(Graphics2D g)
Paints itself. |
protected void |
paintNodes(Graphics2D g)
|
protected String |
paramString()
|
void |
removeChartListener(ChartListener l)
Removes the specified chart listener so that it no longer receives chart events from this chart. |
void |
removeGroupListener(GroupListener l)
Removes the specified group listener so that it no longer receives group events from this chart. |
void |
removeLinkListener(LinkListener l)
Removes the specified link listener so that it no longer receives link events from this chart. |
void |
removeSelection(List nodes)
Removes the nodes from selection |
void |
removeSelection(Node node)
Removes the node from selection |
void |
removeSelectionListener(SelectionListener l)
Removes the specified selection listener so that it no longer receives selection events from this chart. |
void |
repaint(int x,
int y,
int width,
int height)
Repaints the specified area. |
void |
select(Node node)
Selects the node. |
void |
selectAll()
Selects all nodes. |
void |
setContainer(JComponent c)
Sets the container for this chart. |
void |
setGridHeight(int gridHeight)
Sets the grid height. |
void |
setGridMode(GridMode gridMode)
Sets the grid mode for this chart. |
void |
setGridShown(boolean shown)
Sets the grid shown property. |
void |
setGridSize(int gridWidth,
int gridHeight)
Sets the grid size for this chart. |
void |
setGridSnaped(boolean snaped)
Sets the grid snaped property. |
void |
setGridWidth(int gridWidth)
Sets the grid width. |
void |
setRenderingHints(Map hints)
Sets the RenderingHints for rendering. |
void |
setTool(Tool t)
Sets the Tool for this chart. |
void |
startEditingAtNode(Node node)
Starts edit the specified node. |
boolean |
stopEditing()
Ends the current editing session. |
BufferedImage |
toBufferedImage()
Returns a BufferedImage for this chart. |
boolean |
ungroup(GroupNode node)
Ungroup the node. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EventListenerList listenerList
| Constructor Detail |
|---|
public Chart()
| Method Detail |
|---|
public void setContainer(JComponent c)
c - the containergetContainer()public JComponent getContainer()
setContainer(javax.swing.JComponent)public boolean isEditing()
public boolean stopEditing()
public void cancelEditing()
public void startEditingAtNode(Node node)
node - the node to be editedpublic Node getEditingNode()
public Component getEditorComponent()
public void setTool(Tool t)
t - the ToolgetTool()public Tool getTool()
setTool(com.zfqjava.chart.Tool)public void setGridMode(GridMode gridMode)
gridMode - the grid modegetGridMode()public GridMode getGridMode()
setGridMode(com.zfqjava.chart.GridMode)
public void setGridSize(int gridWidth,
int gridHeight)
gridWidth - the grid widthgridHeight - the grid heightpublic void setGridWidth(int gridWidth)
gridWidth - the grid widthgetGridWidth()public int getGridWidth()
setGridWidth(int)public void setGridHeight(int gridHeight)
gridHeight - the grid heightgetGridHeight()public int getGridHeight()
setGridHeight(int)public void setGridSnaped(boolean snaped)
snaped - the grid snaped propertyisGridSnaped()public boolean isGridSnaped()
setGridSnaped(boolean)public void setGridShown(boolean shown)
shown - the grid shown propertyisGridShown()public boolean isGridShown()
setGridShown(boolean)public void doLayout()
Node
doLayout in interface NodedoLayout in class AbstractNode
protected void drawShape(Graphics2D g,
Shape s)
drawShape in class AbstractNode
public Node findNodeAt(int x,
int y)
Node
findNodeAt in interface NodefindNodeAt in class AbstractNodex - the x locationy - the y location
public void moveToFront(Node node)
node - the nodemoveToBack(com.zfqjava.chart.Node)public void moveToBack(Node node)
node - the nodemoveToFront(com.zfqjava.chart.Node)public void addSelection(Node node)
node - the node add to selectionremoveSelection(com.zfqjava.chart.Node)public void addSelection(List nodes)
nodes - the nodes add to selectionremoveSelection(com.zfqjava.chart.Node)public void removeSelection(Node node)
node - the node remove from selectionaddSelection(com.zfqjava.chart.Node)public void removeSelection(List nodes)
nodes - the nodes remove from selectionaddSelection(com.zfqjava.chart.Node)public void clearSelection()
public int getSelectionCount()
public boolean isSelectionEmpty()
public List getSelectionList()
public Node getSelectedNode()
public boolean isSelected(Node node)
node - the node to determine
public void select(Node node)
node - the nodepublic void selectAll()
public List getGroupList()
public boolean isGrouped(Node node)
node - the node to determine
public boolean group(List nodes)
true if changes
as a result of the call. (Otherwise returns false.
nodes - the nodes to group
ungroup(com.zfqjava.chart.GroupNode)public boolean ungroup(GroupNode node)
true if changes
as a result of the call. (Otherwise returns false.
node - the group node
grouppublic void setRenderingHints(Map hints)
hints - the RenderingHints for renderinggetRenderingHints()public Map getRenderingHints()
setRenderingHints(java.util.Map)public BufferedImage toBufferedImage()
public void repaint(int x,
int y,
int width,
int height)
Node
repaint in interface Noderepaint in class AbstractNodepublic Dimension getPreferredSize()
Node
getPreferredSize in interface NodegetPreferredSize in class AbstractNodeprotected Shape createPaintShape()
AbstractNode
createPaintShape in class AbstractNodepublic void paint(Graphics2D g)
Node
paint in interface Nodepaint in class AbstractNodeg - the node Graphics objectprotected void paintNodes(Graphics2D g)
paintNodes in class AbstractNodeprotected AbstractCellRenderer createRenderer()
public AbstractCellRenderer getRenderer()
protected AbstractCellEditor createEditor()
public AbstractCellEditor getEditor()
protected String paramString()
paramString in class AbstractNodepublic void addChartListener(ChartListener l)
l is null,
no exception is thrown and no action is performed.
l - the chart listenerChartEvent,
ChartListener,
removeChartListener(com.zfqjava.chart.event.ChartListener),
getChartListeners()public void removeChartListener(ChartListener l)
l is null,
no exception is thrown and no action is performed.
l - the chart listenerChartEvent,
ChartListener,
addChartListener(com.zfqjava.chart.event.ChartListener),
getChartListeners()public ChartListener[] getChartListeners()
ChartListeners
or an empty array if no chart
listeners are currently registeredaddChartListener(com.zfqjava.chart.event.ChartListener),
removeChartListener(com.zfqjava.chart.event.ChartListener)protected void fireNodeAdded(Node node)
EventListenerListprotected void fireNodeRemoved(Node node)
EventListenerListprotected void fireNodeResized(Node node)
EventListenerListprotected void fireNodeMoved(Node node)
EventListenerListprotected void fireNodeRotated(Node node)
EventListenerListpublic void addSelectionListener(SelectionListener l)
l is null,
no exception is thrown and no action is performed.
l - the selection listenerSelectionEvent,
SelectionListener,
removeSelectionListener(com.zfqjava.chart.event.SelectionListener),
getSelectionListeners()public void removeSelectionListener(SelectionListener l)
l is null,
no exception is thrown and no action is performed.
l - the selection listenerSelectionEvent,
SelectionListener,
addSelectionListener(com.zfqjava.chart.event.SelectionListener),
getSelectionListeners()public SelectionListener[] getSelectionListeners()
SelectionListeners
or an empty array if no chart
listeners are currently registeredaddSelectionListener(com.zfqjava.chart.event.SelectionListener),
removeSelectionListener(com.zfqjava.chart.event.SelectionListener)protected void fireNodeSelected(Node node)
EventListenerListprotected void fireNodeUnselected(Node node)
EventListenerListpublic void addGroupListener(GroupListener l)
l is null,
no exception is thrown and no action is performed.
l - the group listenerGroupEvent,
GroupListener,
removeGroupListener(com.zfqjava.chart.event.GroupListener),
getGroupListeners()public void removeGroupListener(GroupListener l)
l is null,
no exception is thrown and no action is performed.
l - the group listenerGroupEvent,
GroupListener,
addGroupListener(com.zfqjava.chart.event.GroupListener),
getGroupListeners()public GroupListener[] getGroupListeners()
GroupListeners
or an empty array if no chart
listeners are currently registeredaddGroupListener(com.zfqjava.chart.event.GroupListener),
removeGroupListener(com.zfqjava.chart.event.GroupListener)
protected void fireNodeGrouped(GroupNode node,
List nodeList)
EventListenerList
protected void fireNodeUngrouped(GroupNode node,
List nodeList)
EventListenerListpublic void addLinkListener(LinkListener l)
l is null,
no exception is thrown and no action is performed.
l - the link listenerLinkEvent,
LinkListener,
removeLinkListener(com.zfqjava.chart.event.LinkListener),
getLinkListeners()public void removeLinkListener(LinkListener l)
l is null,
no exception is thrown and no action is performed.
l - the node listenerLinkEvent,
LinkListener,
addLinkListener(com.zfqjava.chart.event.LinkListener),
getLinkListeners()public LinkListener[] getLinkListeners()
LinkListeners
or an empty array if no link
listeners are currently registeredaddLinkListener(com.zfqjava.chart.event.LinkListener),
removeLinkListener(com.zfqjava.chart.event.LinkListener)
protected void fireNodeLinked(Link link,
Node startNode,
Node endNode)
EventListenerList
protected void fireNodeUnlinked(Link link,
Node startNode,
Node endNode)
EventListenerListpublic EventListener[] getListeners(Class listenerType)
FooListeners
upon this model.
FooListeners
are registered using the addFooListener method.
You can specify the listenerType argument
with a class literal, such as FooListener.class.
For example, you can query a list model
m
for its list data listeners
with the following code:
ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));If no such listeners exist, this method returns an empty array.
listenerType - the type of listeners requested;
this parameter should specify an interface
that descends from java.util.EventListener
FooListeners
on this model,
or an empty array if no such
listeners have been added
ClassCastException - if listenerType doesn't
specify a class or interface that implements
java.util.EventListener
|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||