Class ImageInput

  • All Implemented Interfaces:
    Input, Part

    public class ImageInput
    extends AbstractInput
    Implementierung eines Auswahlfeldes fuer ein Bild.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageInput​(byte[] image)
      ct.
      ImageInput​(byte[] image, int width, int height)
      ct.
    • Constructor Detail

      • ImageInput

        public ImageInput​(byte[] image)
        ct.
        Parameters:
        image - das Bild.
      • ImageInput

        public ImageInput​(byte[] image,
                          int width,
                          int height)
        ct.
        Parameters:
        image - das Bild.
        width - Breite des Buttons in Pixeln. Default: 80.
        height - Hoehe des Buttons in Pixeln. Default: 80.
    • Method Detail

      • setBorder

        public void setBorder​(int border)
        Legt fest, wieviel Pixel Abstand vom Rand des Buttons gelassen werden soll.
        Parameters:
        border - Anzahl der Pixel zum Button-Rand. Default: 10.
      • setScale

        public void setScale​(boolean scale)
        Legt fest, ob das Bild auf die Button-Groesse skaliert werden soll. Steht der Wert auf False, passt das Bild u.U. nicht auf den Button und wird nur teilweise angezeigt.
        Parameters:
        scale - true, wenn das Bild skaliert werden soll. Default: true
      • disable

        public void disable()
        Description copied from interface: Input
        Deaktiviert das Eingabefeld.
        See Also:
        Input.disable()
      • enable

        public void enable()
        Description copied from interface: Input
        Aktiviert das Eingabefeld.
        See Also:
        Input.enable()
      • focus

        public void focus()
        Description copied from interface: Input
        Gibt diesem Eingabefeld den Focus.
        See Also:
        Input.focus()
      • getControl

        public org.eclipse.swt.widgets.Control getControl()
        Description copied from interface: Input
        Liefert das eigentliche Eingabecontrol. Es muss von jeder abgeleiteten Klasse implementiert werden und das Eingabe-Feld zurueckliefern.

        Da der Implementierer das Composite benoetigt, in dem das Control positioniert werden soll, kann er sich der Methode AbstractInput.getParent() in dieser Klasse bedienen.

        Returns:
        das zu zeichnende Control.
        See Also:
        Input.getControl()
      • setComment

        public void setComment​(java.lang.String comment)
        Description copied from interface: Input
        Fuegt hinter das Eingabefeld noch einen Kommentar. Existiert der Kommentar bereits, wird er gegen den neuen ersetzt.

        Hinweis: Wird die Funktion nicht aufgerufen, bevor das Eingabe-Feld gemalt wird, dann wird es auch nicht angezeigt. Denn vorm Malen muss bekannt sein, ob es angezeigt werden soll, damit der Platz dafuer reserviert werden kann.

        Specified by:
        setComment in interface Input
        Overrides:
        setComment in class AbstractInput
        Parameters:
        comment - Kommentar.
        See Also:
        AbstractInput.setComment(java.lang.String)
      • update

        protected void update()
        Description copied from class: AbstractInput
        Wird immer dann aufgerufen, wenn eines der Controls des Eingabe-Feldes aktualisiert wird. Hier kann dann z.Bsp. geprueft werden, ob der Inhalt des Feldes korrekt ist und ggf. die Hintergrund-Farbe angepasst werden.
        Overrides:
        update in class AbstractInput
        See Also:
        AbstractInput.update()
      • getValue

        public java.lang.Object getValue()
        Description copied from interface: Input
        Liefert den Wert des Eingabefelds.
        Returns:
        Wert des Feldes.
        See Also:
        Input.getValue()
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: Input
        Prueft, ob das Eingabe-Feld aktiv ist.
        Returns:
        true, wenn es aktiv ist.
        See Also:
        Input.isEnabled()
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from interface: Input
        Aktiviert oder deaktiviert das Eingabe-Feld.
        Parameters:
        enabled - true, wenn es aktiv sein soll.
        See Also:
        Input.setEnabled(boolean)
      • setValue

        public void setValue​(java.lang.Object value)
        Description copied from interface: Input
        Schreibt einen neuen Wert in das Eingabefeld.
        Parameters:
        value - der neu anzuzeigende Wert.
        See Also:
        Input.setValue(java.lang.Object)