com.ibm.richtext.uiimpl
Class TabRulerImpl

java.lang.Object
  |
  +--com.ibm.richtext.uiimpl.TabRulerImpl
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public final class TabRulerImpl
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

TabRuler is a Component which presents a user interface for setting the leading margin, trailing margin, first line indent, and tab types and positions.

TabRuler does not implement TextPanelListener directly; however, it can receive updates from a MTextPanel. To have a TabRuler listen to a panel, call listenToPanel. TabRuler responds to user manipulation by modifying the paragraph styles on its MTextPanel (if any).


Field Summary
static java.awt.Color DEFAULT_BACK_COLOR
          The default background color for TabRulers.
 
Constructor Summary
TabRulerImpl(int baseline, int origin, MTextPanel textPanel, java.awt.Component host)
          Create a new TabRuler.
 
Method Summary
 java.awt.Color getBackColor()
          Return the background color of this TabRuler.
 int getFirstLineIndent()
          Return the first line indent of this TabRuler.
 int getLeadingMargin()
          Return the leading margin of this TabRuler.
 java.awt.Dimension getMinimumSize()
          Component override.
 java.awt.Dimension getPreferredSize()
          Component override.
 MTabRuler getRuler()
          Return the MTabRuler represented by this TabRuler.
 int getTrailingMargin()
          Return the trailing margin of this TabRuler.
 void listenToTextPanel(MTextPanel textPanel)
          Listen to the given MTextPanel and reflect its changes, and update its paragraph styles when TabRuler is manipulated.
 void mouseClicked(java.awt.event.MouseEvent e)
          MouseListener method.
 void mouseDragged(java.awt.event.MouseEvent e)
          MouseListener method.
 void mouseEntered(java.awt.event.MouseEvent e)
          MouseListener method.
 void mouseExited(java.awt.event.MouseEvent e)
          MouseListener method.
 void mouseMoved(java.awt.event.MouseEvent e)
          MouseListener method.
 void mousePressed(java.awt.event.MouseEvent e)
          MouseListener method.
 void mouseReleased(java.awt.event.MouseEvent e)
          MouseListener method.
 void paint(java.awt.Graphics g)
          Component method override.
 void setBackColor(java.awt.Color backColor)
          Set the background color of this TabRuler.
 java.lang.String toString()
          Return debugging info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BACK_COLOR

public static final java.awt.Color DEFAULT_BACK_COLOR
The default background color for TabRulers.
See Also:
setBackColor(java.awt.Color)
Constructor Detail

TabRulerImpl

public TabRulerImpl(int baseline,
                    int origin,
                    MTextPanel textPanel,
                    java.awt.Component host)
Create a new TabRuler.
Parameters:
baseline - the y-coordinate of the ruler's baseline
origin - the x-coordinate in this Component where the left margin appears
textPanel - the MTextPanel to listen to. This TabRuler will reflect the MTextPanel's paragraph styles, and update the paragraph styles when manipulated.
Method Detail

listenToTextPanel

public void listenToTextPanel(MTextPanel textPanel)
Listen to the given MTextPanel and reflect its changes, and update its paragraph styles when TabRuler is manipulated.
Parameters:
textPanel - the MTextPanel to listen to

getBackColor

public java.awt.Color getBackColor()
Return the background color of this TabRuler.
Returns:
the background color of this TabRuler

setBackColor

public void setBackColor(java.awt.Color backColor)
Set the background color of this TabRuler.
Parameters:
backColor - the new background color of this TabRuler

toString

public java.lang.String toString()
Return debugging info.
Overrides:
toString in class java.lang.Object

getRuler

public MTabRuler getRuler()
Return the MTabRuler represented by this TabRuler.
Returns:
the MTabRuler represented by this TabRuler

getLeadingMargin

public int getLeadingMargin()
Return the leading margin of this TabRuler.
Returns:
the leading margin of this TabRuler

getFirstLineIndent

public int getFirstLineIndent()
Return the first line indent of this TabRuler.
Returns:
the first line indent of this TabRuler

getTrailingMargin

public final int getTrailingMargin()
Return the trailing margin of this TabRuler.
Returns:
the trailing margin of this TabRuler

paint

public void paint(java.awt.Graphics g)
Component method override.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
MouseListener method.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

getMinimumSize

public java.awt.Dimension getMinimumSize()
Component override.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Component override.


Copyright (c) 2001 IBM Corporation and others.