Exemplo n.º 1
0
  /** Creates a new repaint manager. This should be not be called directly. */
  public TextAreaPainter(JEditTextArea textArea, TextAreaDefaults defaults) {
    this.textArea = textArea;

    setAutoscrolls(true);
    setDoubleBuffered(true);
    setOpaque(true);

    ToolTipManager.sharedInstance().registerComponent(this);

    currentLine = new Segment();
    currentLineIndex = -1;

    setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

    setFont(new Font("Monospaced", Font.PLAIN, 14));
    setForeground(Color.black);
    setBackground(Color.white);

    blockCaret = defaults.blockCaret;
    styles = defaults.styles;
    cols = defaults.cols;
    rows = defaults.rows;
    caretColor = defaults.caretColor;
    selectionColor = defaults.selectionColor;
    lineHighlightColor = defaults.lineHighlightColor;
    lineHighlight = defaults.lineHighlight;
    bracketHighlightColor = defaults.bracketHighlightColor;
    bracketHighlight = defaults.bracketHighlight;
    paintInvalid = defaults.paintInvalid;
    eolMarkerColor = defaults.eolMarkerColor;
    eolMarkers = defaults.eolMarkers;
  }
Exemplo n.º 2
0
  /** Creates a new repaint manager. This should be not be called directly. */
  public TextAreaPainter(JEditTextArea textArea, TextAreaDefaults defaults) {
    this.textArea = textArea;

    setAutoscrolls(true);
    setDoubleBuffered(true);
    setOpaque(true);

    ToolTipManager.sharedInstance().registerComponent(this);

    currentLine = new Segment();
    currentLineIndex = -1;

    setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

    // unfortunately probably can't just do setDefaults() since things aren't quite set up
    setFont(defaults.font);
    setForeground(defaults.fgcolor);
    setBackground(defaults.bgcolor);

    blockCaret = defaults.blockCaret;
    styles = defaults.styles;
    caretColor = defaults.caretColor;
    selectionColor = defaults.selectionColor;
    lineHighlightColor = defaults.lineHighlightColor;
    lineHighlight = defaults.lineHighlight;
    bracketHighlightColor = defaults.bracketHighlightColor;
    bracketHighlight = defaults.bracketHighlight;
    eolMarkerColor = defaults.eolMarkerColor;
    eolMarkers = defaults.eolMarkers;
    antialias = defaults.antialias;

    cols = defaults.cols;
    rows = defaults.rows;
  }
Exemplo n.º 3
0
 public void mouseExited(MouseEvent e) {
   if (e.getSource() == bottomText) {
     bottomText.setCursor(Cursor.getDefaultCursor());
   }
 }
Exemplo n.º 4
0
 /**
  * Follows the reference in an link. The given url is the requested reference. By default this
  * calls <a href="#setPage">setPage</a>, and if an exception is thrown the original previous
  * document is restored and a beep sounded. If an attempt was made to follow a link, but it
  * represented a malformed url, this method will be called with a null argument.
  *
  * @param u the URL to follow
  */
 protected void linkActivated(URL u) {
   Cursor c = html.getCursor();
   Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
   html.setCursor(waitCursor);
   SwingUtilities.invokeLater(new PageLoader(u, c));
 }
Exemplo n.º 5
0
 public void mouseEntered(MouseEvent e) {
   if (e.getSource() == bottomText) {
     bottomText.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
   }
 }