gui.multisource
Class MultisourceBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by gui.multisource.MultisourceBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border

public class MultisourceBorder
extends javax.swing.border.AbstractBorder

A MultisourceBorder is a border that displays a color code indicating the source of text in a MultisourceDocument. The border can be applied to a text pane that contains a multisource document. Its color codes appear to the left of the text.

See Also:
Serialized Form

Constructor Summary
MultisourceBorder(javax.swing.JTextPane tp, MultisourceDocument msd)
          new MultisourceBorder(c, msd) returns a multisource border that reflects the sources for text in msd and can be installed in c.
MultisourceBorder(javax.swing.JTextPane tp, MultisourceDocument msd, int w)
          new MultisourceBorder(tp, msd, w) returns a new multisource border with width w that reflects the sources for text in msd and can be installed on tp.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          msb.getBorderInsets(c) returns the insets for msb in c.
 java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets ins)
          msb.getBorderInsets(c, ins) copies the insets for msb in c into .
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
          The paintBorder() method is invoked by the component in which this border is installed.
 void setSourceColor(java.lang.Object s, java.awt.Color c)
          msb.setSourceColor(s, c) sets the source color for sources whose identifier is s to c.
 
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultisourceBorder

public MultisourceBorder(javax.swing.JTextPane tp,
                         MultisourceDocument msd)
new MultisourceBorder(c, msd) returns a multisource border that reflects the sources for text in msd and can be installed in c.

Parameters:
tp - the text pane
msd - the multisource document

MultisourceBorder

public MultisourceBorder(javax.swing.JTextPane tp,
                         MultisourceDocument msd,
                         int w)
new MultisourceBorder(tp, msd, w) returns a new multisource border with width w that reflects the sources for text in msd and can be installed on tp.

Parameters:
tp - the text pane
msd - the multisource document
Method Detail

setSourceColor

public void setSourceColor(java.lang.Object s,
                           java.awt.Color c)
msb.setSourceColor(s, c) sets the source color for sources whose identifier is s to c.

Parameters:
s -
c -

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
msb.getBorderInsets(c) returns the insets for msb in c.

Specified by:
getBorderInsets in interface javax.swing.border.Border
Overrides:
getBorderInsets in class javax.swing.border.AbstractBorder
Parameters:
c - the component in which the border is installed
Returns:
the insets

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c,
                                       java.awt.Insets ins)
msb.getBorderInsets(c, ins) copies the insets for msb in c into .

Overrides:
getBorderInsets in class javax.swing.border.AbstractBorder
Parameters:
c - the component in which the border is installed
ins - the insets object that receives the insets
Returns:
the insets (ins)

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int w,
                        int h)
The paintBorder() method is invoked by the component in which this border is installed. Other clients will not normally invoke this method.

Specified by:
paintBorder in interface javax.swing.border.Border
Overrides:
paintBorder in class javax.swing.border.AbstractBorder