/** * Get the current font for the row. The font is used as the default * typeface for drawing text for this item. * @param row the table row * @return the current font value */ public Font getFont(int row) { return (Font)get(row, VisualItem.FONT); }
/** * @see java.lang.Object#toString() */ public String toString() { StringBuffer sbuf = new StringBuffer(); sbuf.append("VisualItem[").append(getGroup()); sbuf.append(",").append(m_row).append(','); VisualTable vt = (VisualTable)m_table; int local = vt.getLocalColumnCount(); int inherited = vt.getColumnCount()-local; for ( int i=0; i<inherited; ++i ) { if ( i > 0 ) sbuf.append(','); String name = vt.getColumnName(local+i); sbuf.append(name); sbuf.append('='); if ( vt.canGetString(name) ) sbuf.append(vt.getString(m_row, name)); else sbuf.append(vt.get(m_row, name).toString()); } sbuf.append(']'); return sbuf.toString(); }
ColumnMetadata finishtime_meta = maindatatable.getMetadata(END_FIELD_NAME); ColumnMetadata ycoord_meta = maindatatable.getMetadata("ycoord"); long x_min = (long) ((Double)maindatatable.get(starttime_meta.getMinimumRow(), START_FIELD_NAME)).doubleValue(); long x_max = (long) ((Double)maindatatable.get(finishtime_meta.getMaximumRow(), END_FIELD_NAME)).doubleValue(); xaxis.setRangeModel(new NumberRangeModel(x_min,x_max,x_min,x_max)); float y_max = maindatatable.getFloat(ycoord_meta.getMaximumRow(),"ycoord");
/** * Ediflow dedicated method. * @param tuple an obvious tuple * @param alias an alias * @return an attribute value */ public Object getAttributeValueAtOptimized(Tuple tuple, String alias) { prefuse.data.tuple.TupleSet tupleSet = vis.getVisualGroup(groupName); prefuse.visual.VisualTable visualTable; if (tupleSet instanceof prefuse.visual.VisualTable) { visualTable = (prefuse.visual.VisualTable) tupleSet; } else if (tupleSet instanceof prefuse.data.Graph) { prefuse.data.Graph g = (prefuse.data.Graph) tupleSet; visualTable = (VisualTable) (tuple instanceof Node ? g.getNodeTable() : g.getEdgeTable()); } else { return null; } if (visualTable.getSchema().getColumnIndex(getAliasMap().get(alias)) != -1) { return visualTable.get(tuple.getRow(), alias); } else { return null; } }
/** * Get the current stroke used to draw lines and shape outlines for the * item at the given row. * @return the stroke used to draw lines and shape outlines */ public BasicStroke getStroke(int row) { return (BasicStroke)get(row, VisualItem.STROKE); }
/** * Get the starting font for the row. The font is used as the default * typeface for drawing text for this item. * @param row the table row * @return the starting font value */ public Font getStartFont(int row) { return (Font)get(row, VisualItem.STARTFONT); }
/** * Get the ending font for the row. The font is used as the default * typeface for drawing text for this item. * @param row the table row * @return the ending font value */ public Font getEndFont(int row) { return (Font)get(row, VisualItem.ENDFONT); }
/** * Returns the bounds for the VisualItem at the given row index. The * returned reference is for the actual bounds object used by the * system -- do <b>NOT</b> directly edit the values in this returned * object!! This will corrupt the state of the system. * * @param row the table row * @return the bounding box for the item at the given row */ public Rectangle2D getBounds(int row) { return (Rectangle2D)get(row, VisualItem.BOUNDS); }