org.deegree_impl.graphics.displayelements
Class RotatedLabel

java.lang.Object
  extended byorg.deegree_impl.graphics.displayelements.RotatedLabel
All Implemented Interfaces:
Label

class RotatedLabel
extends java.lang.Object
implements Label

This is a rotated label with style information and screen coordinates, ready to be rendered to the view.

Version:
$Revision: 1.3 $ $Date: 2004/03/12 15:56:47 $
Author:
Markus Schneider

Field Summary
private  int ascent
           
private  java.lang.String caption
           
private  java.awt.Color color
           
private  int descent
           
private  Feature feature
           
private  java.awt.Font font
           
private  int h
           
private  Halo halo
           
private  double rotation
           
private  int w
           
private  int[] xpoints
           
private  int[] ypoints
           
 
Constructor Summary
(package private) RotatedLabel(java.lang.String caption, java.awt.Font font, java.awt.Color color, java.awt.font.LineMetrics metrics, Feature feature, Halo halo, int x, int y, int w, int h, double rotation, double[] anchorPoint, double[] displacement)
           
 
Method Summary
 java.lang.String getCaption()
           
 int getMaxX()
          Returns the rightmost x-coordinate of the label's bounding box.
 int getMaxY()
          Returns the lowermost y-coordinate of the label's bounding box.
 int getMinX()
          Returns the leftmost x-coordinate of the label's bounding box.
 int getMinY()
          Returns the uppermost x-coordinate of the label's bounding box.
 double getRotation()
           
 int getX()
          Returns the x-coordinate of the label.
 int getY()
          Returns the y-coordinate of the label.
 boolean intersects(Label that)
          Determines if the label intersects with another label.
 void paint(java.awt.Graphics2D g)
          Renders the label (including halo) to the submitted Graphics2D context.
 void paintBoundaries(java.awt.Graphics2D g)
          Renders the label's boundaries to the submitted Graphics2D context.
private  void paintHalo(java.awt.Graphics2D g, Halo halo, int x, int y)
          Renders the label's halo to the submitted Graphics2D context.
private  java.awt.Graphics2D setColor(java.awt.Graphics2D g2, java.awt.Color color, double opacity)
           
 java.lang.String toString()
           
private  int[] transformPoint(int x, int y, int tx, int ty, double rotation, double anchorPointX, double anchorPointY, int w, int h, double displacementX, double displacementY)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

caption

private java.lang.String caption

xpoints

private int[] xpoints

ypoints

private int[] ypoints

rotation

private double rotation

w

private int w

h

private int h

color

private java.awt.Color color

font

private java.awt.Font font

descent

private int descent

ascent

private int ascent

halo

private Halo halo

feature

private Feature feature
Constructor Detail

RotatedLabel

RotatedLabel(java.lang.String caption,
             java.awt.Font font,
             java.awt.Color color,
             java.awt.font.LineMetrics metrics,
             Feature feature,
             Halo halo,
             int x,
             int y,
             int w,
             int h,
             double rotation,
             double[] anchorPoint,
             double[] displacement)
Method Detail

getCaption

public java.lang.String getCaption()

getRotation

public double getRotation()

paintBoundaries

public void paintBoundaries(java.awt.Graphics2D g)
Description copied from interface: Label
Renders the label's boundaries to the submitted Graphics2D context. Immensely useful for testing.

Specified by:
paintBoundaries in interface Label
Parameters:
g - Graphics2D context to be used

paint

public void paint(java.awt.Graphics2D g)
Renders the label (including halo) to the submitted Graphics2D context.

Specified by:
paint in interface Label
Parameters:
g - Graphics2D context to be used

paintHalo

private void paintHalo(java.awt.Graphics2D g,
                       Halo halo,
                       int x,
                       int y)
                throws FilterEvaluationException
Renders the label's halo to the submitted Graphics2D context.

Parameters:
g - Graphics2D context to be used
halo - Halo from the SLD
x - x-coordinate of the label
y - y-coordinate of the label
Throws:
FilterEvaluationException - if the evaluation of a ParameterValueType fails

getX

public int getX()
Description copied from interface: Label
Returns the x-coordinate of the label.

Specified by:
getX in interface Label
Returns:

getY

public int getY()
Description copied from interface: Label
Returns the y-coordinate of the label.

Specified by:
getY in interface Label
Returns:

getMaxX

public int getMaxX()
Description copied from interface: Label
Returns the rightmost x-coordinate of the label's bounding box.

Specified by:
getMaxX in interface Label
Returns:

getMaxY

public int getMaxY()
Description copied from interface: Label
Returns the lowermost y-coordinate of the label's bounding box.

Specified by:
getMaxY in interface Label
Returns:

getMinX

public int getMinX()
Description copied from interface: Label
Returns the leftmost x-coordinate of the label's bounding box.

Specified by:
getMinX in interface Label
Returns:

getMinY

public int getMinY()
Description copied from interface: Label
Returns the uppermost x-coordinate of the label's bounding box.

Specified by:
getMinY in interface Label
Returns:

intersects

public boolean intersects(Label that)
Determines if the label intersects with another label.

Specified by:
intersects in interface Label
Parameters:
that - label to test
Returns:
true if the labels intersect

transformPoint

private int[] transformPoint(int x,
                             int y,
                             int tx,
                             int ty,
                             double rotation,
                             double anchorPointX,
                             double anchorPointY,
                             int w,
                             int h,
                             double displacementX,
                             double displacementY)

setColor

private java.awt.Graphics2D setColor(java.awt.Graphics2D g2,
                                     java.awt.Color color,
                                     double opacity)

toString

public java.lang.String toString()