y.view
Class DefaultLabelConfiguration

java.lang.Object
  extended by y.view.DefaultLabelConfiguration
All Implemented Interfaces:
YLabel.BoundsProvider, YLabel.Layout, YLabel.Painter

public class DefaultLabelConfiguration
extends Object
implements YLabel.Painter, YLabel.Layout, YLabel.BoundsProvider

Helper class for use in configuration implementations that can be used in YLabel.Factory.addConfiguration(String, java.util.Map) to serve as a basic implementation. This implementation mimics the default behavior of a YLabel instance.

 
Your browser does not support SVG content.

Constructor Summary
DefaultLabelConfiguration()
           
 
Method Summary
 void calculateContentSize(YLabel label, FontRenderContext frc)
          Delegating method of YLabel.calculateSize(java.awt.font.FontRenderContext)
 void calcUnionRect(YLabel label, Rectangle2D r)
          Delegating method of YLabel.calcUnionRect(java.awt.geom.Rectangle2D)
 boolean contains(YLabel label, double x, double y)
          Delegating method of YLabel.contains(double, double)
 YPoint getIconLocation(YLabel label)
          Delegating method of YLabel.getIconLocation()
 YPoint getTextLocation(YLabel label)
          Delegating method of YLabel.getTextLocation()
 void paint(YLabel label, Graphics2D gfx)
          Delegating method of YLabel.paint(java.awt.Graphics2D)
 void paintBox(YLabel label, Graphics2D gfx, double x, double y, double width, double height)
          Delegating method of YLabel.paintBox(java.awt.Graphics2D, double, double, double, double)
 void paintContent(YLabel label, Graphics2D gfx, double x, double y, double width, double height)
          Delegating method of YLabel.paintContent(java.awt.Graphics2D, double, double, double, double)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLabelConfiguration

public DefaultLabelConfiguration()
Method Detail

calcUnionRect

public void calcUnionRect(YLabel label,
                          Rectangle2D r)
Description copied from interface: YLabel.BoundsProvider
Delegating method of YLabel.calcUnionRect(java.awt.geom.Rectangle2D)

Specified by:
calcUnionRect in interface YLabel.BoundsProvider
Parameters:
label - the label context
r - the bounds to update

paint

public void paint(YLabel label,
                  Graphics2D gfx)
Description copied from interface: YLabel.Painter
Delegating method of YLabel.paint(java.awt.Graphics2D)

Specified by:
paint in interface YLabel.Painter
Parameters:
label - the label context

paintContent

public void paintContent(YLabel label,
                         Graphics2D gfx,
                         double x,
                         double y,
                         double width,
                         double height)
Description copied from interface: YLabel.Painter
Delegating method of YLabel.paintContent(java.awt.Graphics2D, double, double, double, double)

Specified by:
paintContent in interface YLabel.Painter
Parameters:
label - the label context

paintBox

public void paintBox(YLabel label,
                     Graphics2D gfx,
                     double x,
                     double y,
                     double width,
                     double height)
Description copied from interface: YLabel.Painter
Delegating method of YLabel.paintBox(java.awt.Graphics2D, double, double, double, double)

Specified by:
paintBox in interface YLabel.Painter
Parameters:
label - the label context

getTextLocation

public YPoint getTextLocation(YLabel label)
Description copied from interface: YLabel.Painter
Delegating method of YLabel.getTextLocation()

Specified by:
getTextLocation in interface YLabel.Painter
Parameters:
label - the label context

getIconLocation

public YPoint getIconLocation(YLabel label)
Description copied from interface: YLabel.Painter
Delegating method of YLabel.getIconLocation()

Specified by:
getIconLocation in interface YLabel.Painter
Parameters:
label - the label context

calculateContentSize

public void calculateContentSize(YLabel label,
                                 FontRenderContext frc)
Description copied from interface: YLabel.Layout
Delegating method of YLabel.calculateSize(java.awt.font.FontRenderContext)

Specified by:
calculateContentSize in interface YLabel.Layout
Parameters:
label - the label context
frc - the font render context.

contains

public boolean contains(YLabel label,
                        double x,
                        double y)
Description copied from interface: YLabel.Layout
Delegating method of YLabel.contains(double, double)

Specified by:
contains in interface YLabel.Layout
Parameters:
label - the label context

© Copyright 2000-2008,
yWorks GmbH.
All rights reserved.