Java Code Examples for java.awt.peer.LabelPeer

The following are top voted examples for showing how to use java.awt.peer.LabelPeer. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 2
Project: jdk8u-jdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 3
Project: jdk8u-jdk   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 4
Project: openjdk-jdk10   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             {@code text} is {@code null}, it is
 *             treated for display purposes like an empty
 *             string {@code ""}.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 5
Project: openjdk9   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             {@code text} is {@code null}, it is
 *             treated for display purposes like an empty
 *             string {@code ""}.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 6
Project: Java8CN   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 7
Project: jdk8u_jdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 8
Project: jdk8u_jdk   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 9
Project: lookaside_java-1.8.0-openjdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 10
Project: lookaside_java-1.8.0-openjdk   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 11
Project: javify   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text in this label to the specified value.
 *
 * @param text The new text for this label.
 */
public synchronized void setText(String text)
{
  if ((this.text == null && text != null)
      || (this.text != null && ! this.text.equals(text)))
    {
      this.text = text;

      if (peer != null)
       {
         LabelPeer lp = (LabelPeer) peer;
         lp.setText(text);
       }
     invalidate();
    }
}
 
Example 12
Project: jvm-stm   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text in this label to the specified value.
 *
 * @param text The new text for this label.
 */
public synchronized void setText(String text)
{
  if ((this.text == null && text != null)
      || (this.text != null && ! this.text.equals(text)))
    {
      this.text = text;

      if (peer != null)
       {
         LabelPeer lp = (LabelPeer) peer;
         lp.setText(text);
       }
     invalidate();
    }
}
 
Example 13
Project: VarJ   File: Label.java   Source Code and License 6 votes vote down vote up
/**
    * Sets the text for this label to the specified text.
    * @param      text the text that this label displays. If 
    *             <code>text</code> is <code>null</code>, it is 
    *             treated for display purposes like an empty 
    *             string <code>""</code>.
    * @see        java.awt.Label#getText
    */
   public void setText(String text) {
       boolean testvalid = false;
synchronized (this) {
    if (text != this.text && (this.text == null ||
			      !this.text.equals(text))) {
        this.text = text;
	LabelPeer peer = (LabelPeer)this.peer;
	if (peer != null) {
	    peer.setText(text);
	}
	testvalid = true;
    }
}

// This could change the preferred size of the Component.
if (testvalid && valid) {
    invalidate();
}
   }
 
Example 14
Project: jdk-1.7-annotated   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 15
Project: infobip-open-jdk-8   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 16
Project: infobip-open-jdk-8   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 17
Project: jdk8u-dev-jdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 18
Project: jdk8u-dev-jdk   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 19
Project: jdk7-jdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 20
Project: openjdk-source-code-learn   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 21
Project: OLD-OpenJDK8   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 22
Project: OLD-OpenJDK8   File: LabelRepaint.java   Source Code and License 6 votes vote down vote up
void test() {
    setAlignment(getAlignment());
    ((LabelPeer) getPeer()).setAlignment(getAlignment());

    setText("");
    setText(null);
    setText(getText());
    ((LabelPeer) getPeer()).setText("");
    ((LabelPeer) getPeer()).setText(null);
    ((LabelPeer) getPeer()).setText(getText());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
Example 23
Project: JamVM-PH   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text in this label to the specified value.
 *
 * @param text The new text for this label.
 */
public synchronized void setText(String text)
{
  if ((this.text == null && text != null)
      || (this.text != null && ! this.text.equals(text)))
    {
      this.text = text;

      if (peer != null)
       {
         LabelPeer lp = (LabelPeer) peer;
         lp.setText(text);
       }
     invalidate();
    }
}
 
Example 24
Project: openjdk-jdk7u-jdk   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 25
Project: classpath   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text in this label to the specified value.
 *
 * @param text The new text for this label.
 */
public synchronized void setText(String text)
{
  if ((this.text == null && text != null)
      || (this.text != null && ! this.text.equals(text)))
    {
      this.text = text;

      if (peer != null)
       {
         LabelPeer lp = (LabelPeer) peer;
         lp.setText(text);
       }
     invalidate();
    }
}
 
Example 26
Project: openjdk-icedtea7   File: Label.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the text for this label to the specified text.
 * @param      text the text that this label displays. If
 *             <code>text</code> is <code>null</code>, it is
 *             treated for display purposes like an empty
 *             string <code>""</code>.
 * @see        java.awt.Label#getText
 */
public void setText(String text) {
    boolean testvalid = false;
    synchronized (this) {
        if (text != this.text && (this.text == null ||
                                  !this.text.equals(text))) {
            this.text = text;
            LabelPeer peer = (LabelPeer)this.peer;
            if (peer != null) {
                peer.setText(text);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
Example 27
Project: incubator-netbeans   File: FakePeerSupport.java   Source Code and License 5 votes vote down vote up
public static boolean attachFakePeer(Component comp) {
    if (comp == null || comp.isDisplayable()
          || comp instanceof javax.swing.JComponent
          || comp instanceof javax.swing.RootPaneContainer)
        return false;

    FakePeer peer = null;

    if (comp instanceof Label)
        peer = getFakePeer(LabelPeer.class, new FakeLabelPeer((Label) comp));
    else if (comp instanceof Button)
        peer = getFakePeer(ButtonPeer.class, new FakeButtonPeer((Button) comp));                   
    else if (comp instanceof Panel)
        peer = getFakePeer(new Class[] {ContainerPeer.class, PanelPeer.class}, new FakePanelPeer((Panel) comp));
    else if (comp instanceof TextField)
        peer = getFakePeer(new Class[] {TextFieldPeer.class, TextComponentPeer.class}, new FakeTextFieldPeer((TextField) comp));
    else if (comp instanceof TextArea)
        peer = getFakePeer(new Class[] {TextAreaPeer.class, TextComponentPeer.class}, new FakeTextAreaPeer((TextArea) comp));
    else if (comp instanceof TextComponent)
        peer = getFakePeer(TextComponentPeer.class, new FakeTextComponentPeer((TextComponent) comp));
    else if (comp instanceof Checkbox)
        peer = getFakePeer(CheckboxPeer.class, new FakeCheckboxPeer((Checkbox) comp));
    else if (comp instanceof Choice)
        peer = getFakePeer(ChoicePeer.class, new FakeChoicePeer((Choice) comp));
    else if (comp instanceof List)
        peer = getFakePeer(ListPeer.class, new FakeListPeer((List) comp));
    else if (comp instanceof Scrollbar)
        peer = getFakePeer(ScrollbarPeer.class, new FakeScrollbarPeer((Scrollbar) comp));
    else if (comp instanceof ScrollPane)
        peer = getFakePeer(new Class[] {ContainerPeer.class, ScrollPanePeer.class}, new FakeScrollPanePeer((ScrollPane) comp));
    else if (comp instanceof Canvas)
        peer = getFakePeer(CanvasPeer.class, new FakeCanvasPeer((Canvas) comp));
    else
        return false;

    attachFakePeer(comp, peer);
    return true;
}
 
Example 28
Project: OpenJSharp   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 29
Project: jdk8u-jdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 30
Project: openjdk-jdk10   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are {@code Label.LEFT},
 * {@code Label.RIGHT}, and {@code Label.CENTER}.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          {@code alignment} is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 31
Project: openjdk9   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are {@code Label.LEFT},
 * {@code Label.RIGHT}, and {@code Label.CENTER}.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          {@code alignment} is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 32
Project: Java8CN   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 33
Project: jdk8u_jdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 34
Project: lookaside_java-1.8.0-openjdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 35
Project: javify   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the text alignment of this label to the specified value.
 *
 * @param alignment The desired alignment for the text in this label,
 * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
 * <code>RIGHT</code>.
 */
public synchronized void setAlignment(int alignment)
{
  if (alignment != CENTER && alignment != LEFT && alignment != RIGHT)
    throw new IllegalArgumentException("invalid alignment: " + alignment);
  this.alignment = alignment;
  if (peer != null)
    {
      LabelPeer lp = (LabelPeer) peer;
      lp.setAlignment(alignment);
    }
}
 
Example 36
Project: jvm-stm   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the text alignment of this label to the specified value.
 *
 * @param alignment The desired alignment for the text in this label,
 * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
 * <code>RIGHT</code>.
 */
public synchronized void setAlignment(int alignment)
{
  if (alignment != CENTER && alignment != LEFT && alignment != RIGHT)
    throw new IllegalArgumentException("invalid alignment: " + alignment);
  this.alignment = alignment;
  if (peer != null)
    {
      LabelPeer lp = (LabelPeer) peer;
      lp.setAlignment(alignment);
    }
}
 
Example 37
Project: VarJ   File: Label.java   Source Code and License 5 votes vote down vote up
/**
    * Sets the alignment for this label to the specified alignment.
    * Possible values are <code>Label.LEFT</code>,
    * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
    * @param      alignment    the alignment to be set.
    * @exception  IllegalArgumentException if an improper value for
    *                          <code>alignment</code> is given.
    * @see        java.awt.Label#getAlignment
    */
   public synchronized void setAlignment(int alignment) {
switch (alignment) {
  case LEFT:
  case CENTER:
  case RIGHT:
    this.alignment = alignment;
   	    LabelPeer peer = (LabelPeer)this.peer;
    if (peer != null) {
	peer.setAlignment(alignment);
    }
    return;
}
throw new IllegalArgumentException("improper alignment: " + alignment);
   }
 
Example 38
Project: jdk-1.7-annotated   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 39
Project: infobip-open-jdk-8   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 40
Project: jdk8u-dev-jdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 41
Project: jdk7-jdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 42
Project: openjdk-source-code-learn   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 43
Project: OLD-OpenJDK8   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 44
Project: JamVM-PH   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the text alignment of this label to the specified value.
 *
 * @param alignment The desired alignment for the text in this label,
 * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
 * <code>RIGHT</code>.
 */
public synchronized void setAlignment(int alignment)
{
  if (alignment != CENTER && alignment != LEFT && alignment != RIGHT)
    throw new IllegalArgumentException("invalid alignment: " + alignment);
  this.alignment = alignment;
  if (peer != null)
    {
      LabelPeer lp = (LabelPeer) peer;
      lp.setAlignment(alignment);
    }
}
 
Example 45
Project: openjdk-jdk7u-jdk   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 46
Project: classpath   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the text alignment of this label to the specified value.
 *
 * @param alignment The desired alignment for the text in this label,
 * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
 * <code>RIGHT</code>.
 */
public synchronized void setAlignment(int alignment)
{
  if (alignment != CENTER && alignment != LEFT && alignment != RIGHT)
    throw new IllegalArgumentException("invalid alignment: " + alignment);
  this.alignment = alignment;
  if (peer != null)
    {
      LabelPeer lp = (LabelPeer) peer;
      lp.setAlignment(alignment);
    }
}
 
Example 47
Project: openjdk-icedtea7   File: Label.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the alignment for this label to the specified alignment.
 * Possible values are <code>Label.LEFT</code>,
 * <code>Label.RIGHT</code>, and <code>Label.CENTER</code>.
 * @param      alignment    the alignment to be set.
 * @exception  IllegalArgumentException if an improper value for
 *                          <code>alignment</code> is given.
 * @see        java.awt.Label#getAlignment
 */
public synchronized void setAlignment(int alignment) {
    switch (alignment) {
      case LEFT:
      case CENTER:
      case RIGHT:
        this.alignment = alignment;
        LabelPeer peer = (LabelPeer)this.peer;
        if (peer != null) {
            peer.setAlignment(alignment);
        }
        return;
    }
    throw new IllegalArgumentException("improper alignment: " + alignment);
}
 
Example 48
Project: incubator-netbeans   File: UtilitiesTest.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target) throws HeadlessException {
    throw new IllegalStateException("Method not implemented");
}
 
Example 49
Project: javify   File: XToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  checkHeadLess("No LabelPeer can be created in an headless graphics " +
                    "environment.");
  return new SwingLabelPeer(target);
}
 
Example 50
Project: javify   File: GtkToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel (Label label)
{
  checkHeadless();
  return new GtkLabelPeer (label);
}
 
Example 51
Project: javify   File: QtToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  return new QtLabelPeer( this, target );
}
 
Example 52
Project: javify   File: HeadlessToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  throw new HeadlessException();
}
 
Example 53
Project: jvm-stm   File: XToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  checkHeadLess("No LabelPeer can be created in an headless graphics " +
  		      "environment.");
  return new SwingLabelPeer(target);
}
 
Example 54
Project: jvm-stm   File: GtkToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel (Label label) 
{
  checkHeadless();
  return new GtkLabelPeer (label);
}
 
Example 55
Project: jvm-stm   File: QtToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  return new QtLabelPeer( this, target );
}
 
Example 56
Project: jvm-stm   File: HeadlessToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  throw new HeadlessException();
}
 
Example 57
Project: cn1   File: HeadlessToolkit.java   Source Code and License 4 votes vote down vote up
@Override
protected LabelPeer createLabel(Label a0) throws HeadlessException {
    throw new HeadlessException();
}
 
Example 58
Project: JamVM-PH   File: XToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  checkHeadLess("No LabelPeer can be created in an headless graphics " +
  		      "environment.");
  return new SwingLabelPeer(target);
}
 
Example 59
Project: JamVM-PH   File: GtkToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel (Label label) 
{
  checkHeadless();
  return new GtkLabelPeer (label);
}
 
Example 60
Project: JamVM-PH   File: QtToolkit.java   Source Code and License 4 votes vote down vote up
protected LabelPeer createLabel(Label target)
{
  return new QtLabelPeer( this, target );
}