com.googlecode.sarasvati.visual
Class DefaultGraphLookAndFeel

java.lang.Object
  extended by com.googlecode.sarasvati.visual.DefaultGraphLookAndFeel
All Implemented Interfaces:
GraphLookAndFeel

public class DefaultGraphLookAndFeel
extends Object
implements GraphLookAndFeel

Generates widgets for nodes using the Adaptable.getAdaptor(Class) method, passing in the Component class. It will wrap the returned component in a ComponentWidget instance.

Author:
Paul Lorenz

Field Summary
protected  boolean drawArcLabels
           
protected  boolean drawSelfArcs
           
static DefaultGraphLookAndFeel INSTANCE
           
 
Constructor Summary
DefaultGraphLookAndFeel(boolean drawSelfArcs, boolean drawArcLabels)
           
 
Method Summary
 boolean drawArcLabels(Arc arc)
          Controls if arc labels should be drawn.
 boolean drawSelfArcs(Arc arc)
          Controls if self arcs should be drawn.
 org.netbeans.api.visual.widget.Widget newWidget(Node node, SarasvatiGraphScene scene)
          Returns a new Widget to represent the given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultGraphLookAndFeel INSTANCE

drawSelfArcs

protected boolean drawSelfArcs

drawArcLabels

protected boolean drawArcLabels
Constructor Detail

DefaultGraphLookAndFeel

public DefaultGraphLookAndFeel(boolean drawSelfArcs,
                               boolean drawArcLabels)
Method Detail

drawArcLabels

public boolean drawArcLabels(Arc arc)
Description copied from interface: GraphLookAndFeel
Controls if arc labels should be drawn.

Specified by:
drawArcLabels in interface GraphLookAndFeel
Returns:
True if arc labels should be drawn, false otherwise

drawSelfArcs

public boolean drawSelfArcs(Arc arc)
Description copied from interface: GraphLookAndFeel
Controls if self arcs should be drawn.

Specified by:
drawSelfArcs in interface GraphLookAndFeel
Returns:
True if self arcs should be drawn, false otherwise

newWidget

public org.netbeans.api.visual.widget.Widget newWidget(Node node,
                                                       SarasvatiGraphScene scene)
Description copied from interface: GraphLookAndFeel
Returns a new Widget to represent the given node.

Specified by:
newWidget in interface GraphLookAndFeel
Parameters:
node - The node we need a widget for
scene - The scene the widget is created in
Returns:
A new widget for the given node


Copyright © 2012. All Rights Reserved.