@Override public final PhylogenyData copy() { return new NodeVisualData( !ForesterUtil.isEmpty( getFontName() ) ? new String( getFontName() ) : null, getFontStyle(), getFontSize(), getFontColor() != null ? new Color( getFontColor().getRed(), getFontColor() .getGreen(), getFontColor().getBlue() ) : null, getShape(), getFillType(), getNodeColor() != null ? new Color( getNodeColor().getRed(), getNodeColor() .getGreen(), getNodeColor().getBlue() ) : null, getSize(), getTransparency() ); }
@Override public final StringBuffer asSimpleText() { return asText(); }
public final boolean isEmpty() { return ( ForesterUtil.isEmpty( getFontName() ) && ( getFontStyle() == FontType.PLAIN ) && ( getFontSize() == DEFAULT_FONT_SIZE ) && ( getFontColor() == null ) && ( getShape() == NodeShape.DEFAULT ) && ( getFillType() == NodeFill.DEFAULT ) && ( getNodeColor() == null ) && ( getSize() == DEFAULT_SIZE ) && ( getTransparency() == DEFAULT_TRANSPARENCY ) ); }
public final Font getFont() { if ( _font != null ) { return _font; } else if ( !ForesterUtil.isEmpty( getFontName() ) ) { _font = new Font( getFontName(), getFontStyleInt(), getFontSize() ); return _font; } return null; }
private void changeNodeFont( final PhylogenyNode node ) { final FontChooser fc = new FontChooser(); Font f = null; if ( ( node.getNodeData().getNodeVisualData() != null ) && !node.getNodeData().getNodeVisualData().isEmpty() ) { f = node.getNodeData().getNodeVisualData().getFont(); for( final PhylogenyNode n : nodes ) { if ( n.getNodeData().getNodeVisualData() == null ) { n.getNodeData().setNodeVisualData( new NodeVisualData() ); vd.setFontName( ff.getFamily().trim() ); int s = ff.getSize(); if ( s < 0 ) { s = Byte.MAX_VALUE; vd.setFontSize( s ); vd.setFontStyle( ff.getStyle() );
|| ( getOptions().isShowDefaultNodeShapesForMarkedNodes() && ( node.getNodeData().getNodeVisualData() != null ) && ( !node.getNodeData() .getNodeVisualData().isEmpty() ) ) || ( getControlPanel().isUseVisualStyles() && ( ( node.getNodeData().getNodeVisualData() != null ) && ( ( node .getNodeData().getNodeVisualData().getNodeColor() != null ) || ( node.getNodeData().getNodeVisualData().getSize() != NodeVisualData.DEFAULT_SIZE ) || ( node.getNodeData().getNodeVisualData().getFillType() != NodeFill.DEFAULT ) || ( node .getNodeData().getNodeVisualData().getShape() != NodeShape.DEFAULT ) ) ) ) || ( getControlPanel().isEvents() && node.isHasAssignedEvent() && ( node.getNodeData().getEvent() .isDuplication() NodeVisualData vis = null; if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null ) && ( !node.getNodeData().getNodeVisualData().isEmpty() ) ) { vis = node.getNodeData().getNodeVisualData(); if ( ( vis != null ) && ( vis.getSize() != NodeVisualData.DEFAULT_SIZE ) ) { box_size = vis.getSize(); if ( vis.getNodeColor() != null ) { outline_color = vis.getNodeColor(); else if ( vis.getFontColor() != null ) { outline_color = vis.getFontColor(); if ( vis.getShape() == NodeShape.CIRCLE ) { shape = NodeShape.CIRCLE; else if ( vis.getShape() == NodeShape.RECTANGLE ) {
if ( chart_only ) { while ( it.hasNext() ) { final NodeVisualData vis = new NodeVisualData(); vis.setFillType( NodeFill.SOLID ); vis.setShape( NodeShape.RECTANGLE ); vis.setNodeColor( min_color ); it.next().getNodeData().setNodeVisualData( vis ); n.setName( n.getName() + " [" + i + "]" ); if ( !chart_only ) { final NodeVisualData vis = new NodeVisualData(); vis.setFillType( NodeFill.SOLID ); vis.setShape( NodeShape.RECTANGLE ); vis.setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(), min, max, mean_color, max_color ) ); n.getNodeData().setNodeVisualData( vis ); n.getNodeData() .getNodeVisualData() .setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(), min, max,
private final static void colorizeNodesHelper( final Color c, final PhylogenyNode node ) { if ( node.getNodeData().getNodeVisualData() == null ) { node.getNodeData().setNodeVisualData( new NodeVisualData() ); } node.getNodeData().getNodeVisualData().setFontColor( new Color( c.getRed(), c.getGreen(), c.getBlue() ) ); }
&& ( prop.getAppliesTo() == AppliesTo.NODE ) ) { if ( node.getNodeData().getNodeVisualData() == null ) { node.getNodeData().setNodeVisualData( new NodeVisualData() ); node.getNodeData().getNodeVisualData().parseProperty( prop );
public final int getFontStyleInt() { if ( getFontStyle() == FontType.BOLD ) { return Font.BOLD; } else if ( getFontStyle() == FontType.ITALIC ) { return Font.ITALIC; } else if ( getFontStyle() == FontType.BOLD_ITALIC ) { return Font.BOLD + Font.ITALIC; } return Font.PLAIN; }
private boolean setFont( final Graphics2D g, final PhylogenyNode node, final boolean is_in_found_nodes ) { Font visual_font = null; if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null ) ) { visual_font = node.getNodeData().getNodeVisualData().getFont(); g.setFont( visual_font != null ? visual_font : getTreeFontSet().getLargeFont() ); } else { g.setFont( getTreeFontSet().getLargeFont() ); } if ( is_in_found_nodes ) { g.setFont( g.getFont().deriveFont( Font.BOLD ) ); } return visual_font != null; }
&& ( node.getNodeData().getNodeVisualData().getFontColor() != null ) ) { g.setColor( node.getNodeData().getNodeVisualData().getFontColor() );
@Override public final String toString() { return asText().toString(); }
private final List<Property> toProperties() { final List<Property> properties = new ArrayList<Property>(); if ( !ForesterUtil.isEmpty( getFontName() ) ) { properties.add( new Property( FONT_REF, getFontName(), "", FONT_TYPE, AppliesTo.NODE ) ); if ( getFontSize() != DEFAULT_FONT_SIZE ) { properties.add( new Property( FONT_SIZE_REF, String.valueOf( getFontSize() ), "", FONT_SIZE_TYPE, AppliesTo.NODE ) ); if ( getFontStyle() != FontType.PLAIN ) { String font_style = ""; if ( getFontStyle() == FontType.ITALIC ) { font_style = FONT_STYLE_ITALIC; else if ( getFontStyle() == FontType.BOLD ) { font_style = FONT_STYLE_BOLD; else if ( getFontStyle() == FontType.BOLD_ITALIC ) { font_style = FONT_STYLE_BOLD_ITALIC; throw new RuntimeException( "unknown font style" + getShape() ); if ( getFontColor() != null ) { properties.add( new Property( FONT_COLOR_REF, colorToHex( getFontColor() ), "", FONT_COLOR_TYPE,