2 * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
\r
4 * The program is provided "as is" without any warranty express or
\r
5 * implied, including the warranty of non-infringement and the implied
\r
6 * warranties of merchantibility and fitness for a particular purpose.
\r
7 * IBM will not be liable for any damages suffered by you as a result
\r
8 * of using the Program. In no event will IBM be liable for any
\r
9 * special, indirect or consequential damages or lost profits even if
\r
10 * IBM has been advised of the possibility of their occurrence. IBM
\r
11 * will not be liable for any third party claims against you.
\r
13 package com.ibm.richtext.awtui;
\r
15 import java.awt.Color;
\r
16 import com.ibm.richtext.styledtext.MTabRuler;
\r
17 import com.ibm.richtext.textpanel.MTextPanel;
\r
20 * MTabRulerComponent is implemented by components which provide a tab-ruler
\r
21 * interface for interacting with an MTextPanel.
\r
23 * Users interact with MTabRulerComponent implementations as follows:
\r
25 * <li>The leading margin can be set by dragging the bottom half
\r
26 * of the leftmost triangle. The first-line indent will "stick" with
\r
27 * the leading margin.</li>
\r
28 * <li>The first-line indent can be set by dragging the top half of the
\r
29 * leftmost triangle. The first-line indent applies to the first line of
\r
31 * <li>The trailing margin can be set by dragging the rightmost triangle.</li>
\r
32 * <li>Tabs can be added to the ruler by clicking the mouse on the ruler with the
\r
33 * control key pressed. Four kinds of tabs are provided: leading, trailing, center,
\r
34 * and decimal. The type of a tab can be changed by double-clicking the tab.</li>
\r
35 * <li>Tabs can be repositioned by dragging them with the mouse.</li>
\r
38 * MTabRulerComponent's appearance will reflect the paragraph styles in the
\r
39 * first selected paragraph. Style changes performed with an
\r
40 * MTabRulerComponent will apply to all selected paragraphs.
\r
42 public interface MTabRulerComponent {
\r
44 static final String COPYRIGHT =
\r
45 "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
\r
48 * Listen to the given MTextPanel and reflect its changes,
\r
49 * and update its paragraph styles when TabRuler is
\r
51 * @param textPanel the MTextPanel to listen to
\r
53 public void listenToTextPanel(MTextPanel textPanel);
\r
56 * Return the background color of this TabRuler.
\r
57 * @return the background color of this TabRuler
\r
59 public Color getBackColor();
\r
62 * Set the background color of this TabRuler.
\r
63 * @param backColor the new background color of this TabRuler
\r
65 public void setBackColor(Color backColor);
\r
68 * Return the MTabRuler represented by this TabRuler.
\r
69 * @return the MTabRuler represented by this TabRuler
\r
71 public MTabRuler getRuler();
\r
74 * Return the leading margin of this TabRuler.
\r
75 * @return the leading margin of this TabRuler
\r
77 public int getLeadingMargin();
\r
80 * Return the first line indent of this TabRuler.
\r
81 * @return the first line indent of this TabRuler
\r
83 public int getFirstLineIndent();
\r
86 * Return the trailing margin of this TabRuler.
\r
87 * @return the trailing margin of this TabRuler
\r
89 public int getTrailingMargin();
\r