Package javax.swing.plaf

Examples of javax.swing.plaf.TextUI


   * Override to get no Line-Wraps
   */
  public boolean getScrollableTracksViewportWidth() {
    if (getParent() instanceof JViewport) {
      JViewport port = (JViewport) getParent();
      TextUI textUI = getUI();
      int w = port.getWidth();
      textUI.getMinimumSize(this);
      textUI.getMaximumSize(this);
      Dimension pref = textUI.getPreferredSize(this);
     
      if ((w >= pref.width)) {
        return true;
      }
    }
View Full Code Here


  protected synchronized void damage(Rectangle r) {
    if (r != null)
      try {
        JTextComponent comp = getComponent();
        TextUI mapper = comp.getUI();
        Rectangle r2 = mapper.modelToView(comp, getDot() + 1);
        int width = r2.x - r.x;
        if (width == 0)
          width = 8;
        comp.repaint(r.x, r.y, width, r.height);
        x = r.x;
View Full Code Here

  public void paint(Graphics g) {
    if (isVisible())
      try {
        JTextComponent comp = getComponent();
        TextUI mapper = comp.getUI();
        Rectangle r1 = mapper.modelToView(comp, getDot());
        Rectangle r2 = mapper.modelToView(comp, getDot() + 1);
        g = g.create();
        g.setColor(comp.getForeground());
        g.setXORMode(comp.getBackground());
        int width = r2.x - r1.x;
        if (width == 0)
View Full Code Here

        return keymapName;
    }

    public void testCreateKeymap() {
        JTextComponent.removeKeymap("BasicTextAreaUI");
        TextUI ui = jta.getUI();
        Keymap keymap = ((BasicTextUI) ui).createKeymap();
        assertEquals(getKeymapName(jta), keymap.getName());
        assertTrue(keymap.getDefaultAction() instanceof DefaultEditorKit.DefaultKeyTypedAction);
        assertEquals(0, keymap.getBoundActions().length);
        assertEquals(0, keymap.getBoundKeyStrokes().length);
View Full Code Here

        assertTrue(index >= 0);
        return str.replaceFirst(subStr, "");
    }

    public void testUninstallUI() throws Exception {
        TextUI ui = jta.getUI();
        assertTrue(ui instanceof TextAreaUI);
        TextAreaUI.callOrder = "";
        jta.setVisible(false);
        jta.getUI().uninstallUI(jta);
        String tmp = TextAreaUI.callOrder;
View Full Code Here

    public void testInstallUI() throws Exception {
        Caret caret = jta.getCaret();
        Highlighter highlighter = jta.getHighlighter();
        String prefix = ((BasicTextUI) tf.getUI()).getPropertyPrefix();
        (jta.getUI()).uninstallUI(jta);
        TextUI ui = jta.getUI();
        assertTrue(ui instanceof TextAreaUI);
        TextAreaUI.callOrder = "";
        (jta.getUI()).installUI(jta);
        String tmp = TextAreaUI.callOrder;
        tmp = findAndRemoveSubstring(tmp, "installUI::");
View Full Code Here

        return keymapName;
    }

    public void testCreateKeymap() {
        JTextComponent.removeKeymap("BasicTextAreaUI");
        TextUI ui = jta.getUI();
        Keymap keymap = ((BasicTextUI) ui).createKeymap();
        assertEquals(getKeymapName(jta), keymap.getName());
        assertTrue(keymap.getDefaultAction() instanceof DefaultEditorKit.DefaultKeyTypedAction);
        assertEquals(0, keymap.getBoundActions().length);
        assertEquals(0, keymap.getBoundKeyStrokes().length);
View Full Code Here

        assertTrue(index >= 0);
        return str.replaceFirst(subStr, "");
    }

    public void testUninstallUI() throws Exception {
        TextUI ui = jta.getUI();
        assertTrue(ui instanceof TextAreaUI);
        TextAreaUI.callOrder = "";
        jta.setVisible(false);
        jta.getUI().uninstallUI(jta);
        String tmp = TextAreaUI.callOrder;
View Full Code Here

    public void testInstallUI() throws Exception {
        Caret caret = jta.getCaret();
        Highlighter highlighter = jta.getHighlighter();
        String prefix = ((BasicTextUI) tf.getUI()).getPropertyPrefix();
        (jta.getUI()).uninstallUI(jta);
        TextUI ui = jta.getUI();
        assertTrue(ui instanceof TextAreaUI);
        TextAreaUI.callOrder = "";
        (jta.getUI()).installUI(jta);
        String tmp = TextAreaUI.callOrder;
        tmp = findAndRemoveSubstring(tmp, "installUI::");
View Full Code Here

  public static JTextArea ta3 = new JTextArea(markup);

  public void test(TestHarness harness)
  {
    ta3.setLineWrap(true);
    TextUI ui = ta3.getUI();
    View rootView = ui.getRootView(ta3);
    View view = rootView.getView(0);

    Dimension min = ta3.getMinimumSize();
    harness.check (min.width, view.getMinimumSpan(View.X_AXIS));
    harness.check (min.height, view.getMinimumSpan(View.Y_AXIS));
View Full Code Here

TOP

Related Classes of javax.swing.plaf.TextUI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.