/** * Constructs a new cell for the given parameters. * * @param value Object that represents the value of the cell. * @param geometry Specifies the geometry of the cell. * @param style Specifies the style as a formatted string. */ public mxCell(Object value, mxGeometry geometry, String style) { setValue(value); setGeometry(geometry); setStyle(style); }
/** * Constructs a new cell for the given parameters. * * @param value Object that represents the value of the cell. * @param geometry Specifies the geometry of the cell. * @param style Specifies the style as a formatted string. */ public mxCell(Object value, mxGeometry geometry, String style) { setValue(value); setGeometry(geometry); setStyle(style); }
cell.setValue(value); String id = value.getAttribute("id");
cell.setValue(value); String id = value.getAttribute("id");
@Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell cell : vertices ) { cell.setValue( tc.getValue() ); graph.getSpotFor( cell ).setName( tc.getValue().toString() ); } lGraphComponent.refresh(); lGraphComponent.removeListener( this ); } } );
@Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell cell : vertices ) { cell.setValue( tc.getValue() ); graph.getSpotFor( cell ).setName( tc.getValue().toString() ); } lGraphComponent.refresh(); lGraphComponent.removeListener( this ); } } );
@Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } );
@Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } );
public mxCell addJGraphTVertex( final Spot vertex ) { if ( vertexToCellMap.containsKey( vertex ) ) { // cell for Spot already existed, skip creation and return original // cell. return vertexToCellMap.get( vertex ); } mxCell cell = null; getModel().beginUpdate(); try { cell = new mxCell( vertex, new mxGeometry(), "" ); cell.setVertex( true ); cell.setId( null ); cell.setValue( vertex.getName() ); addCell( cell, defaultParent ); vertexToCellMap.put( vertex, cell ); cellToVertexMap.put( cell, vertex ); } finally { getModel().endUpdate(); } return cell; }
public mxCell addJGraphTVertex( final Spot vertex ) { if ( vertexToCellMap.containsKey( vertex ) ) { // cell for Spot already existed, skip creation and return original // cell. return vertexToCellMap.get( vertex ); } mxCell cell = null; getModel().beginUpdate(); try { cell = new mxCell( vertex, new mxGeometry(), "" ); cell.setVertex( true ); cell.setId( null ); cell.setValue( vertex.getName() ); addCell( cell, defaultParent ); vertexToCellMap.put( vertex, cell ); cellToVertexMap.put( cell, vertex ); } finally { getModel().endUpdate(); } return cell; }
public mxCell addJGraphTEdge( final DefaultWeightedEdge edge ) { if ( edgeToCellMap.containsKey( edge ) ) { // cell for edge already existed, skip creation and return original // cell. return edgeToCellMap.get( edge ); } mxCell cell = null; getModel().beginUpdate(); try { final Spot source = tmm.getTrackModel().getEdgeSource( edge ); final Spot target = tmm.getTrackModel().getEdgeTarget( edge ); cell = new mxCell( edge ); cell.setEdge( true ); cell.setId( null ); cell.setValue( String.format( "%.1f", tmm.getTrackModel().getEdgeWeight( edge ) ) ); cell.setGeometry( new mxGeometry() ); cell.getGeometry().setRelative( true ); addEdge( cell, defaultParent, vertexToCellMap.get( source ), vertexToCellMap.get( target ), null ); edgeToCellMap.put( edge, cell ); cellToEdgeMap.put( cell, edge ); } finally { getModel().endUpdate(); } return cell; }
public mxCell addJGraphTEdge( final DefaultWeightedEdge edge ) { if ( edgeToCellMap.containsKey( edge ) ) { // cell for edge already existed, skip creation and return original // cell. return edgeToCellMap.get( edge ); } mxCell cell = null; getModel().beginUpdate(); try { final Spot source = tmm.getTrackModel().getEdgeSource( edge ); final Spot target = tmm.getTrackModel().getEdgeTarget( edge ); cell = new mxCell( edge ); cell.setEdge( true ); cell.setId( null ); cell.setValue( String.format( "%.1f", tmm.getTrackModel().getEdgeWeight( edge ) ) ); cell.setGeometry( new mxGeometry() ); cell.getGeometry().setRelative( true ); addEdge( cell, defaultParent, vertexToCellMap.get( source ), vertexToCellMap.get( target ), null ); edgeToCellMap.put( edge, cell ); cellToEdgeMap.put( cell, edge ); } finally { getModel().endUpdate(); } return cell; }
/** * Returns a clone of the cell. */ public Object clone() throws CloneNotSupportedException { mxCell clone = (mxCell) super.clone(); clone.setValue(cloneValue()); clone.setStyle(getStyle()); clone.setCollapsed(isCollapsed()); clone.setConnectable(isConnectable()); clone.setEdge(isEdge()); clone.setVertex(isVertex()); clone.setVisible(isVisible()); clone.setParent(null); clone.setSource(null); clone.setTarget(null); clone.children = null; clone.edges = null; mxGeometry geometry = getGeometry(); if (geometry != null) { clone.setGeometry((mxGeometry) geometry.clone()); } return clone; }
/** * Returns a clone of the cell. */ public Object clone() throws CloneNotSupportedException { mxCell clone = (mxCell) super.clone(); clone.setValue(cloneValue()); clone.setStyle(getStyle()); clone.setCollapsed(isCollapsed()); clone.setConnectable(isConnectable()); clone.setEdge(isEdge()); clone.setVertex(isVertex()); clone.setVisible(isVisible()); clone.setParent(null); clone.setSource(null); clone.setTarget(null); clone.children = null; clone.edges = null; mxGeometry geometry = getGeometry(); if (geometry != null) { clone.setGeometry((mxGeometry) geometry.clone()); } return clone; }