gov.noaa.pmel.sgt
Class LabelDrawer1

java.lang.Object
  extended by gov.noaa.pmel.sgt.LabelDrawer1
All Implemented Interfaces:
LabelDrawer, java.io.Serializable, java.lang.Cloneable

public class LabelDrawer1
extends java.lang.Object
implements LabelDrawer, java.lang.Cloneable

Implements label drawing for JDK1.1

Since:
2.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Serialized Form

Constructor Summary
LabelDrawer1(java.lang.String lbl, double hgt, Point2D.Double loc, int valign, int halign)
           
 
Method Summary
 LabelDrawer copy()
           
 void draw(java.awt.Graphics g)
          Used internally by sgt.
 double getAngle()
          Get label drawing angle.
 java.awt.Rectangle getBounds()
          Get the label bounds in device units.
 Rectangle2D.Double getBoundsP()
          Get the label reference location in physcial coordinates.
 java.awt.Color getColor()
          Get the color.
 java.awt.Font getFont()
          Get the font.
 int getHAlign()
          Get the horizontal alignment.
 double getHeightP()
          Get the label height in physical coordinates.
 Layer getLayer()
          Get the layer.
 java.awt.Point getLocation()
          Get the label position in device coordinates.
 Point2D.Double getLocationP()
          Get the label reference location in physcial coordinates.
 int getOrientation()
          Get the origentation.
 float getStringHeight(java.awt.Graphics g)
          Get the string height in device units.
 float getStringWidth(java.awt.Graphics g)
          Get the string width in device units.
 java.lang.String getText()
          Get the label text.
 int getVAlign()
          Get the vertical alignment.
 boolean isVisible()
          Is label visible?
 void setAngle(double angle)
          Draw label at arbitrary rotation.
 void setBounds(int x, int y, int width, int height)
          Set the label bounds in device units.
 void setColor(java.awt.Color clr)
          Set the color.
 void setFont(java.awt.Font font)
          Set the font.
 void setHAlign(int halign)
          Set the horizontal alignment.
 void setHeightP(double hgt)
          Set the height of the label in physical coordinates.
 void setLayer(Layer layer)
          Used internally by sgt.
 void setLocation(java.awt.Point loc)
          Set the label position in device coordinates.
 void setLocationP(Point2D.Double loc)
          Set the label reference location in physcial coordinates.
 void setOrientation(int orient)
          Set the orientation.
 void setText(java.lang.String lbl)
          Set the label text.
 void setVAlign(int valign)
          Set the vertical alignment.
 void setVisible(boolean vis)
          Set visibility of label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelDrawer1

public LabelDrawer1(java.lang.String lbl,
                    double hgt,
                    Point2D.Double loc,
                    int valign,
                    int halign)
Method Detail

copy

public LabelDrawer copy()

draw

public void draw(java.awt.Graphics g)
          throws LayerNotFoundException
Description copied from interface: LabelDrawer
Used internally by sgt.

Specified by:
draw in interface LabelDrawer
Throws:
LayerNotFoundException

setText

public void setText(java.lang.String lbl)
Description copied from interface: LabelDrawer
Set the label text.

Specified by:
setText in interface LabelDrawer
Parameters:
lbl - the label text

getText

public java.lang.String getText()
Description copied from interface: LabelDrawer
Get the label text.

Specified by:
getText in interface LabelDrawer
Returns:
the label text

setColor

public void setColor(java.awt.Color clr)
Description copied from interface: LabelDrawer
Set the color.

Specified by:
setColor in interface LabelDrawer
See Also:
Color

getColor

public java.awt.Color getColor()
Description copied from interface: LabelDrawer
Get the color.

Specified by:
getColor in interface LabelDrawer
Returns:
The current color of the label.

setFont

public void setFont(java.awt.Font font)
Description copied from interface: LabelDrawer
Set the font.

Specified by:
setFont in interface LabelDrawer
See Also:
Font

getFont

public java.awt.Font getFont()
Description copied from interface: LabelDrawer
Get the font.

Specified by:
getFont in interface LabelDrawer
Returns:
The current font for the label.

setLayer

public void setLayer(Layer layer)
Description copied from interface: LabelDrawer
Used internally by sgt.

Specified by:
setLayer in interface LabelDrawer

getLayer

public Layer getLayer()
Description copied from interface: LabelDrawer
Get the layer.

Specified by:
getLayer in interface LabelDrawer
Returns:
the layer object.

setOrientation

public void setOrientation(int orient)
Description copied from interface: LabelDrawer
Set the orientation. The orientation can be HORIZONTAL or VERTICAL.

Specified by:
setOrientation in interface LabelDrawer
Parameters:
orient - The orientation.

getOrientation

public int getOrientation()
Description copied from interface: LabelDrawer
Get the origentation.

Specified by:
getOrientation in interface LabelDrawer
Returns:
the orientation

setHAlign

public void setHAlign(int halign)
Description copied from interface: LabelDrawer
Set the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT.

Specified by:
setHAlign in interface LabelDrawer

getHAlign

public int getHAlign()
Description copied from interface: LabelDrawer
Get the horizontal alignment.

Specified by:
getHAlign in interface LabelDrawer
Returns:
the horizontal alignment.

setVAlign

public void setVAlign(int valign)
Description copied from interface: LabelDrawer
Set the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM.

Specified by:
setVAlign in interface LabelDrawer

getVAlign

public int getVAlign()
Description copied from interface: LabelDrawer
Get the vertical alignment.

Specified by:
getVAlign in interface LabelDrawer
Returns:
the vertical alignment.

setLocation

public void setLocation(java.awt.Point loc)
Description copied from interface: LabelDrawer
Set the label position in device coordinates.

Specified by:
setLocation in interface LabelDrawer
Parameters:
loc - label position

getLocation

public java.awt.Point getLocation()
Description copied from interface: LabelDrawer
Get the label position in device coordinates.

Specified by:
getLocation in interface LabelDrawer
Returns:
the label position

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: LabelDrawer
Set the label bounds in device units.

Specified by:
setBounds in interface LabelDrawer
Parameters:
x - x location of label
y - y location of label
width - label width
height - label height

getBounds

public java.awt.Rectangle getBounds()
Description copied from interface: LabelDrawer
Get the label bounds in device units.

Specified by:
getBounds in interface LabelDrawer
Returns:
the label bounds

setLocationP

public void setLocationP(Point2D.Double loc)
Description copied from interface: LabelDrawer
Set the label reference location in physcial coordinates.

Specified by:
setLocationP in interface LabelDrawer
Parameters:
loc - physical location of label

getLocationP

public Point2D.Double getLocationP()
Description copied from interface: LabelDrawer
Get the label reference location in physcial coordinates.

Specified by:
getLocationP in interface LabelDrawer
Returns:
the labels position.

getBoundsP

public Rectangle2D.Double getBoundsP()
Description copied from interface: LabelDrawer
Get the label reference location in physcial coordinates.

Specified by:
getBoundsP in interface LabelDrawer
Returns:
the labels position.

setAngle

public void setAngle(double angle)
Description copied from interface: LabelDrawer
Draw label at arbitrary rotation. Warning: Rotated labels are not drawn very well when using JDK1.1. For best results use JDK1.2 or newer.

Specified by:
setAngle in interface LabelDrawer

getAngle

public double getAngle()
Description copied from interface: LabelDrawer
Get label drawing angle.

Specified by:
getAngle in interface LabelDrawer

setHeightP

public void setHeightP(double hgt)
Description copied from interface: LabelDrawer
Set the height of the label in physical coordinates.

Specified by:
setHeightP in interface LabelDrawer
Parameters:
hgt - The label height.

getHeightP

public double getHeightP()
Description copied from interface: LabelDrawer
Get the label height in physical coordinates.

Specified by:
getHeightP in interface LabelDrawer
Returns:
The label height.

setVisible

public void setVisible(boolean vis)
Description copied from interface: LabelDrawer
Set visibility of label.

Specified by:
setVisible in interface LabelDrawer

isVisible

public boolean isVisible()
Description copied from interface: LabelDrawer
Is label visible?

Specified by:
isVisible in interface LabelDrawer

getStringWidth

public float getStringWidth(java.awt.Graphics g)
Description copied from interface: LabelDrawer
Get the string width in device units.

Specified by:
getStringWidth in interface LabelDrawer

getStringHeight

public float getStringHeight(java.awt.Graphics g)
Description copied from interface: LabelDrawer
Get the string height in device units.

Specified by:
getStringHeight in interface LabelDrawer