/** * Inner callback to update the mxGeometry of the given mxCell using * mxCell.setGeometry and return the previous mxGeometry. */ protected mxGeometry geometryForCellChanged(Object cell, mxGeometry geometry) { mxGeometry previous = getGeometry(cell); ((mxICell) cell).setGeometry(geometry); return previous; }
/** * Inner callback to update the mxGeometry of the given mxCell using * mxCell.setGeometry and return the previous mxGeometry. */ protected mxGeometry geometryForCellChanged(Object cell, mxGeometry geometry) { mxGeometry previous = getGeometry(cell); ((mxICell) cell).setGeometry(geometry); return previous; }
/** * Insert a spot in the {@link TrackSchemeFrame}, by creating a * {@link mxCell} in the graph model of this frame and position it according * to its feature. */ private mxICell insertSpotInGraph( final Spot spot, final int targetColumn ) { mxICell cellAdded = graph.getCellFor( spot ); if ( cellAdded != null ) { // cell for spot already exist, do nothing and return original spot return cellAdded; } // Instantiate JGraphX cell cellAdded = graph.addJGraphTVertex( spot ); // Position it final int row = spot.getFeature( Spot.FRAME ).intValue(); final double x = ( targetColumn - 1 ) * X_COLUMN_SIZE - DEFAULT_CELL_WIDTH / 2; final double y = ( 0.5 + row ) * Y_COLUMN_SIZE - DEFAULT_CELL_HEIGHT / 2; final mxGeometry geometry = new mxGeometry( x, y, DEFAULT_CELL_WIDTH, DEFAULT_CELL_HEIGHT ); cellAdded.setGeometry( geometry ); // Set its style final double radiusFactor = ( Double ) displaySettings.get( KEY_SPOT_RADIUS_RATIO ); if ( null != spotImageUpdater && doThumbnailCapture ) { final String imageStr = spotImageUpdater.getImageString( spot, radiusFactor ); graph.getModel().setStyle( cellAdded, mxConstants.STYLE_IMAGE + "=" + "data:image/base64," + imageStr ); } return cellAdded; }
/** * Insert a spot in the {@link TrackSchemeFrame}, by creating a * {@link mxCell} in the graph model of this frame and position it according * to its feature. */ private mxICell insertSpotInGraph( final Spot spot, final int targetColumn ) { mxICell cellAdded = graph.getCellFor( spot ); if ( cellAdded != null ) { // cell for spot already exist, do nothing and return original spot return cellAdded; } // Instantiate JGraphX cell cellAdded = graph.addJGraphTVertex( spot ); // Position it final int row = spot.getFeature( Spot.FRAME ).intValue(); final double x = ( targetColumn - 1 ) * X_COLUMN_SIZE - DEFAULT_CELL_WIDTH / 2; final double y = ( 0.5 + row ) * Y_COLUMN_SIZE - DEFAULT_CELL_HEIGHT / 2; final mxGeometry geometry = new mxGeometry( x, y, DEFAULT_CELL_WIDTH, DEFAULT_CELL_HEIGHT ); cellAdded.setGeometry( geometry ); // Set its style final double radiusFactor = ( Double ) displaySettings.get( KEY_SPOT_RADIUS_RATIO ); if ( null != spotImageUpdater && doThumbnailCapture ) { final String imageStr = spotImageUpdater.getImageString( spot, radiusFactor ); graph.getModel().setStyle( cellAdded, mxConstants.STYLE_IMAGE + "=" + "data:image/base64," + imageStr ); } return cellAdded; }