本文整理汇总了Java中edu.uci.ics.jung.algorithms.layout.RadialTreeLayout类的典型用法代码示例。如果您正苦于以下问题:Java RadialTreeLayout类的具体用法?Java RadialTreeLayout怎么用?Java RadialTreeLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RadialTreeLayout类属于edu.uci.ics.jung.algorithms.layout包,在下文中一共展示了RadialTreeLayout类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
/**
* Method actionPerformed. Dictates what actions to take when an Action Event
* is performed.
*
* @param e ActionEvent - The event that triggers the actions in the method.
*/
@Override
public void actionPerformed( ActionEvent e ) {
// Get if the button is selected
JToggleButton button = JToggleButton.class.cast( e.getSource() );
setLayout( view.getEffectiveLayout() );
if ( !button.isSelected() ) {
if ( lay instanceof BalloonLayout ) {
view.removePreRenderPaintable( rings );
}
else if ( lay instanceof RadialTreeLayout ) {
view.removePreRenderPaintable( treeRings );
}
}
else {
if ( lay instanceof BalloonLayout ) {
view.addPreRenderPaintable( rings );
}
else if ( lay instanceof RadialTreeLayout ) {
view.addPreRenderPaintable( treeRings );
}
}
view.repaint();
}
示例2: actionPerformed
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// Get if the button is selected
JToggleButton button = (JToggleButton) e.getSource();
if(!button.isSelected()){
button.setSelected(false);
if(lay instanceof BalloonLayout)
view.removePreRenderPaintable(rings);
else if (lay instanceof RadialTreeLayout)
view.removePreRenderPaintable(treeRings);
}
else{
button.setSelected(true);
if(lay instanceof BalloonLayout)
view.addPreRenderPaintable(rings);
else if (lay instanceof RadialTreeLayout){
view.addPreRenderPaintable(treeRings);
}
}
view.repaint();
}
示例3: setGraphLayout
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public void setGraphLayout(Layout lay){
if(lay instanceof BalloonLayout || lay instanceof RadialTreeLayout){
rings.setGraph(gps.forest);
showRingsButton = true;
btnRingsButton.setEnabled(true);
//btnRingsButton.doClick();
//btnRingsButton.doClick();
}
else{
showRingsButton = false;
btnRingsButton.setEnabled(false);
btnRingsButton.setSelected(false);
}
rings.setLayout(lay);
}
示例4: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V, E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new java.util.LinkedHashMap<String, Class>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext()) {
addItem(it.next());
}
addActionListener(this);
}
示例5: onNetworkChange
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
@Override
public void onNetworkChange() {
// concurrent modification of the ARF layouts for simulation position
// updates
if (layout instanceof ARF2Layout) {
((ARF2Layout<Vertex, Edge>) layout).step();
((ARF2Layout<Vertex, Edge>) layout).resetUpdates();
} else if (layout instanceof WeightedARF2Layout) {
((WeightedARF2Layout<Vertex, Edge>) layout).step();
((WeightedARF2Layout<Vertex, Edge>) layout).resetUpdates();
}
/*
* else if (layout instanceof IterativeContext) { for(int i = 0; i <
* network.getVertexCount(); ++i) { ((IterativeContext)layout).step();
*
* } }
*/
if (layout instanceof FixedLayout) {
((FixedLayout<Vertex, Edge>) layout).update();
}
// non-iterative layouts need to be explicitly reset
if (layout instanceof TreeLayout || layout instanceof RadialTreeLayout || layout instanceof CircleLayout || layout instanceof KCoreLayout
|| layout instanceof WeightedKCoreLayout) {
stopLayout();
setNetwork(((BrowsableForestNetwork) getNetwork()).getOriginalNetwork());
resumeLayout();
}
this.repaintViewer();
}
示例6: setLayout
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
/**
* Method setLayout. Sets the layout that the listener will access.
*
* @param lay Layout
*/
private void setLayout( Layout lay ) {
this.lay = lay;
if ( lay instanceof BalloonLayout ) {
this.rings.setLayout( BalloonLayout.class.cast( lay ) );
}
else if ( lay instanceof RadialTreeLayout ) {
this.treeRings.setLayout( RadialTreeLayout.class.cast( lay ) );
}
}
示例7: setEnabled
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
@Override
public void setEnabled( boolean b ) {
super.setEnabled( b );
if ( !b ) {
if ( lay instanceof BalloonLayout ) {
view.removePreRenderPaintable( rings );
}
else if ( lay instanceof RadialTreeLayout ) {
view.removePreRenderPaintable( treeRings );
}
view.repaint();
}
}
示例8: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V, E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new LinkedHashMap<>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext()) {
addItem(it.next());
}
addActionListener(this);
}
示例9: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V,E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new java.util.LinkedHashMap<String, Class>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext())
addItem(it.next());
addActionListener(this);
}
示例10: setLayout
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public void setLayout(Layout lay){
this.lay = lay;
if(lay instanceof BalloonLayout)
this.rings.setLayout(lay);
else if (lay instanceof RadialTreeLayout)
this.treeRings.setLayout(lay);
}
示例11: setLayout
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public void setLayout(Layout layout){
this.radialLayout = (RadialTreeLayout) layout;
}
示例12: getInstance
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
public static DIHelper getInstance()
{
if(helper == null)
{
helper = new DIHelper();
// need to set up the shapes here
//Shape square = new Rectangle2D.Double(-5,-5,10, 10);
//new Graphics2D().dr
//square = (Shape) g2;
//Shape circle = new Ellipse2D.Double(-5, -5, 10, 10);
Ellipse2D.Double circle = new Ellipse2D.Double(-6, -6, 12, 12);
Rectangle2D.Double square = new Rectangle2D.Double(-6,-6,12, 12);
//RoundRectangle2D.Double round = new RoundRectangle2D.Double(-6,-6,12, 12, 6, 6);
Shape triangle = helper.createUpTriangle(6);
Shape star = helper.createStar();
Shape rhom = helper.createRhombus(7);
Shape hex = helper.createHex(7);
Shape pent = helper.createPent(7);
helper.localProp.put(Constants.SQUARE, square);
helper.localProp.put(Constants.CIRCLE, circle);
helper.localProp.put(Constants.TRIANGLE, triangle);
helper.localProp.put(Constants.STAR, star);
helper.localProp.put(Constants.DIAMOND, rhom);
helper.localProp.put(Constants.HEXAGON, hex);
helper.localProp.put(Constants.PENTAGON, pent);
Shape squareL = new Rectangle2D.Double(0,0,40, 40);
Shape circleL = new Ellipse2D.Double(0, 0, 13, 13);
Shape triangleL = helper.createUpTriangleL();
Shape starL = helper.createStarL();
Shape rhomL = helper.createRhombusL();
Shape pentL = helper.createPentL();
Shape hexL = helper.createHexL();
helper.localProp.put(Constants.SQUARE + Constants.LEGEND, squareL);
helper.localProp.put(Constants.CIRCLE + Constants.LEGEND, circleL);
helper.localProp.put(Constants.TRIANGLE + Constants.LEGEND, triangleL);
helper.localProp.put(Constants.STAR + Constants.LEGEND, starL);
helper.localProp.put(Constants.HEXAGON + Constants.LEGEND, hex);
helper.localProp.put(Constants.DIAMOND + Constants.LEGEND, rhomL);
helper.localProp.put(Constants.PENTAGON + Constants.LEGEND, pentL);
helper.localProp.put(Constants.HEXAGON + Constants.LEGEND, hexL);
Color blue = new Color(31, 119, 180);
Color green = new Color(44, 160, 44);
Color red = new Color(214, 39, 40);
Color brown = new Color(143, 99, 42);
Color yellow = new Color(254, 208, 2);
Color orange = new Color(255, 127, 14);
Color purple = new Color(148, 103, 189);
Color aqua = new Color(23, 190, 207);
Color pink = new Color(241, 47, 158);
helper.localProp.put(Constants.BLUE, blue);
helper.localProp.put(Constants.GREEN, green);
helper.localProp.put(Constants.RED, red);
helper.localProp.put(Constants.BROWN, brown);
helper.localProp.put(Constants.MAGENTA, pink);
helper.localProp.put(Constants.YELLOW, yellow);
helper.localProp.put(Constants.ORANGE, orange);
helper.localProp.put(Constants.PURPLE, purple);
helper.localProp.put(Constants.AQUA, aqua);
// put all the layouts as well
helper.localProp.put(Constants.FR, FRLayout.class);
helper.localProp.put(Constants.KK, KKLayout.class);
helper.localProp.put(Constants.ISO, ISOMLayout.class);
helper.localProp.put(Constants.SPRING, SpringLayout.class);
helper.localProp.put(Constants.CIRCLE_LAYOUT, CircleLayout.class);
helper.localProp.put(Constants.RADIAL_TREE_LAYOUT, RadialTreeLayout.class);
helper.localProp.put(Constants.TREE_LAYOUT, TreeLayout.class);
helper.localProp.put(Constants.BALLOON_LAYOUT, BalloonLayout.class);
}
return helper;
}
示例13: setLayout
import edu.uci.ics.jung.algorithms.layout.RadialTreeLayout; //导入依赖的package包/类
/**
* Method setLayout. - Sets the type of layout, casts to radial tree layout
*
* @param layout Layout - the type of layout this is set to
*/
public void setLayout( RadialTreeLayout<SEMOSSVertex, SEMOSSEdge> layout ) {
this.radialLayout = layout;
}