JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCAxisTitle

java.lang.Object
  |
  +--com.klg.jclass.chart.TrackChange
        |
        +--com.klg.jclass.chart.ChartInteriorRegion
              |
              +--com.klg.jclass.chart.ChartText
                    |
                    +--com.klg.jclass.chart.JCAxisTitle
All Implemented Interfaces:
Changeable, Changeable, com.klg.jclass.chart.Drawable, com.klg.jclass.util.JCName, Serializable

public class JCAxisTitle
extends ChartText

Class that controls the appearance of an axis title (that is, the title placement and text).

See Also:
Serialized Form

Field Summary
protected  int effectivePlacement
          The actual placement used to place the axis title.
protected  com.klg.jclass.chart.DerivedInt placement
          The placement value as set by the user (or not, if using default)
 
Fields inherited from class com.klg.jclass.chart.ChartText
adjust, buffer, CENTER, DEG_0, DEG_180, DEG_270, DEG_90, DEG_OTHER, isHTML, LEFT, parentAxis, rendComp, RIGHT, rotation, text
 
Fields inherited from class com.klg.jclass.chart.ChartInteriorRegion
background, dimIsDefaultChangedToTrue, font, foreground, groupingUsed, height, insets, inUpdate, left, name, needsRepaint, numberLocalization, parentChart, parentRegion, top, transparent, updateParent, visible, width
 
Fields inherited from class com.klg.jclass.chart.TrackChange
changed, changedFlag
 
Fields inherited from interface com.klg.jclass.chart.Changeable
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW
 
Fields inherited from interface com.klg.jclass.util.Changeable
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Constructor Summary
JCAxisTitle()
          Default constructor for JCAxisTitle.
JCAxisTitle(String title)
          Constructor for JCAxisTitle that sets the contents of the title as a convenience.
 
Method Summary
protected  void fixPlacement(com.klg.jclass.chart.JCAxis axis)
          Fix the placement, generating the effectivePlacement property.
 int getEffectivePlacement()
          Gets the effective value of the Placement property of the JCTitleAxis given current information.
 int getPlacement()
          Gets the actual value of the Placement property of the JCTitleAxis.
 boolean getPlacementIsDefault()
          Gets the value of the PlacementIsDefault property.
 void layout()
          Performs layout on the axis title.
 void setPlacement(int place)
          Sets the Placement property of the JCTitleAxis.
 void setPlacementIsDefault(boolean pid)
          Sets the value of the PlacementIsDefault property.
 void setText(String nc, boolean setVisible)
          Sets the Text property.
 
Methods inherited from class com.klg.jclass.chart.ChartText
calcLineSize, calcSize, draw, getAdjust, getBackground, getFont, getFontMetrics, getForeground, getRotation, getText, preferredSize, recalc, recalc, setAdjust, setParentChart, setRotation, setText, toString
 
Methods inherited from class com.klg.jclass.chart.ChartInteriorRegion
getDrawingArea, getDrawingArea, getGraphics, getGroupingUsed, getHeight, getHeightIsDefault, getInsets, getLeft, getLeftIsDefault, getName, getNumberFormatter, getNumberLocalization, getParentChart, getParentRegion, getSize, getTop, getTopIsDefault, getWidth, getWidthIsDefault, hide, insets, inside, isVisible, location, repaint, setBackground, setBounds, setChanged, setChanged, setFont, setForeground, setGroupingUsed, setHeight, setHeightIsDefault, setInsets, setLeft, setLeftIsDefault, setLocation, setName, setNumberFormatterLocale, setNumberLocalization, setParentRegion, setSize, setTop, setTopIsDefault, setVisible, setWidth, setWidthIsDefault, show, size, sizeChanged, updateParent
 
Methods inherited from class com.klg.jclass.chart.TrackChange
getChanged, getChanged, isBatched, isChanged, isChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

placement

protected com.klg.jclass.chart.DerivedInt placement
The placement value as set by the user (or not, if using default)


effectivePlacement

protected int effectivePlacement
The actual placement used to place the axis title. Calculated in fixPlacement() from the user-set or default placement as well as other facotrs.

Constructor Detail

JCAxisTitle

public JCAxisTitle()
Default constructor for JCAxisTitle. Makes an unattached axis title.


JCAxisTitle

public JCAxisTitle(String title)
Constructor for JCAxisTitle that sets the contents of the title as a convenience.

Parameters:
title - String representing the axis title
Method Detail

setText

public void setText(String nc,
                    boolean setVisible)
Sets the Text property.

Overrides:
setText in class ChartText
Parameters:
nc - new string contents of the ChartText instance
setVisible - if true, Visible indication is set to true

setPlacement

public void setPlacement(int place)
Sets the Placement property of the JCTitleAxis. The Placement property controls where the JCAxis title is placed relative to the "opposing" axis. Valid values include JCLegend.NORTH or JCLegend.SOUTH for horizontal axes, and JCLegend.EAST, JCLegend.WEST, JCLegend.NORTHEAST, JCLegend.SOUTHEAST, JCLegend.NORTHWEST or JCLegend.SOUTHEAST for vertical axes.

Parameters:
place - one of NORTH or SOUTH for horizontal axes, and EAST/WEST/NORTHEAST/SOUTHEAST/NORTHWEST/SOUTHEAST for vertical axes.
Throws:
IllegalArgumentException - If Placement is not one of NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST or SOUTHWEST.

getPlacement

public int getPlacement()
Gets the actual value of the Placement property of the JCTitleAxis. The Placement property controls where the JCAxis title is placed relative to the "opposing" axis. Valid values include JCLegend.NORTH or JCLegend.SOUTH for horizontal axes, and JCLegend.EAST, JCLegend.WEST, JCLegend.NORTHEAST, JCLegend.SOUTHEAST, JCLegend.NORTHWEST or JCLegend.SOUTHEAST for vertical axes.

Returns:
the actual value of the Placement property, one of NORTH,SOUTH,EAST,WEST,NORTHEAST,SOUTHEAST,NORTHWEST or SOUTHEAST.

setPlacementIsDefault

public void setPlacementIsDefault(boolean pid)
Sets the value of the PlacementIsDefault property. The PlacementIsDefault property determines whether Chart is responsible for calculating a reasonable default placement for the axis title.

Parameters:
pid - true if the default placement is to be used, false otherwise.

getPlacementIsDefault

public boolean getPlacementIsDefault()
Gets the value of the PlacementIsDefault property. The PlacementIsDefault property determines whether Chart is responsible for calculating a reasonable default placement for the axis title.

Returns:
true if the default placement is to be used, false otherwise.

getEffectivePlacement

public int getEffectivePlacement()
Gets the effective value of the Placement property of the JCTitleAxis given current information. This is the actual value used to control where the JCAxis title is placed. If the value of the Placement property is a value that is not allowed considering the orientation of the current axis, a default value is used.

Returns:
One of NORTH or SOUTH for horizontal axes, and EAST/WEST/NORTHEAST/SOUTHEAST/NORTHWEST/SOUTHEAST for vertical axes.

fixPlacement

protected void fixPlacement(com.klg.jclass.chart.JCAxis axis)
Fix the placement, generating the effectivePlacement property. This is done by looking at existing value of the placement property and determining whether it is allowable on the existing axes. If not a suitable value is chosen.

Parameters:
axis - JCAxis instance that this title is being placed against

layout

public void layout()
Performs layout on the axis title.


Copyright © 2004 Quest Software Inc..
All rights reserved.