Package aurelienribon.ui.css

Examples of aurelienribon.ui.css.Property


* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class JComponentProcessor implements DeclarationSetProcessor<JComponent>, ArProperties {
  @Override
  public void process(JComponent target, DeclarationSet ds) {
    Property p = SwingProperties.border;

    if (ds.contains(p)) {
      GroupBorder border = getGroupBorder(ds);

      if (border != null) {
View Full Code Here


      }
    }
  }

  private GroupBorder getGroupBorder(DeclarationSet ds) {
    Property p = SwingProperties.border;
    Object o = ds.getValue(p).get(0);

    if (o instanceof GroupBorder) return (GroupBorder) o;
    if (o instanceof CompoundBorder) {
      Border insideBorder = ((CompoundBorder) ds.getValue(p).get(0)).getInsideBorder();
View Full Code Here

  public Paint getFill() {return fill;}

  private static class CompactCheckBoxProcessor implements DeclarationSetProcessor<CompactCheckBox>, ArProperties {
    @Override
    public void process(CompactCheckBox t, DeclarationSet ds) {
      Property p;
      p = stroke; if (ds.contains(p)) t.setStroke(ds.getValue(p, Paint.class));
      p = fill; if (ds.contains(p)) t.setFill(ds.getValue(p, Paint.class));
    }
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class JTextAreaProcessor implements DeclarationSetProcessor<JTextArea>, SwingProperties {
  @Override
  public void process(JTextArea t, DeclarationSet ds) {
    Property p;

    p = lineWrap; if (ds.contains(p)) t.setLineWrap(ds.getValue(p, Boolean.class));
    p = wrapStyleWord; if (ds.contains(p)) t.setWrapStyleWord(ds.getValue(p, Boolean.class));
    p = tabSize; if (ds.contains(p)) t.setTabSize(ds.getValue(p, Integer.class));
  }
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class JComponentProcessor implements DeclarationSetProcessor<JComponent>, SwingProperties {
  @Override
  public void process(JComponent t, DeclarationSet ds) {
    Property p;

    p = opaque; if (ds.contains(p)) t.setOpaque(ds.getValue(p, Boolean.class));
    p = tooltip; if (ds.contains(p)) t.setToolTipText(ds.getValue(p, String.class));
    p = border; if (ds.contains(p)) t.setBorder(ds.getValue(p, Border.class));
  }
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class JLabelProcessor implements DeclarationSetProcessor<JLabel>, SwingProperties {
  @Override
  public void process(JLabel t, DeclarationSet ds) {
    Property p;

    p = horizAlign; if (ds.contains(p)) t.setHorizontalAlignment(SwingUtils.asHAlign(ds.getValue(p, String.class)));
    p = vertAlign; if (ds.contains(p)) t.setVerticalAlignment(SwingUtils.asVAlign(ds.getValue(p, String.class)));
    p = text; if (ds.contains(p)) t.setText(ds.getValue(p, String.class));
    p = icon; if (ds.contains(p)) t.setIcon(ds.getValue(p, Icon.class, SwingFunctions.icon));
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class AbstractButtonProcessor implements DeclarationSetProcessor<AbstractButton>, SwingProperties {
  @Override
  public void process(AbstractButton t, DeclarationSet ds) {
    Property p;
   
    p = borderPainted; if (ds.contains(p)) t.setBorderPainted(ds.getValue(p, Boolean.class));
    p = contentAreaFilled; if (ds.contains(p)) t.setContentAreaFilled(ds.getValue(p, Boolean.class));
    p = margin; if (ds.contains(p)) t.setMargin(ds.getValue(p, Insets.class, SwingFunctions.insets));
    p = horizAlign; if (ds.contains(p)) t.setHorizontalAlignment(SwingUtils.asHAlign(ds.getValue(p, String.class)));
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class ComponentProcessor implements DeclarationSetProcessor<Component>, SwingProperties {
  @Override
  public void process(Component t, DeclarationSet ds) {
    Property p;

    p = background; if (ds.contains(p)) t.setBackground(ds.getValue(p, Color.class));
    p = foreground; if (ds.contains(p)) t.setForeground(ds.getValue(p, Color.class));
    p = visible; if (ds.contains(p)) t.setVisible(ds.getValue(p, Boolean.class));
    p = enabled; if (ds.contains(p)) t.setEnabled(ds.getValue(p, Boolean.class));
View Full Code Here

* @author Aurelien Ribon | http://www.aurelienribon.com/
*/
public class JTextComponentProcessor implements DeclarationSetProcessor<JTextComponent>, SwingProperties {
  @Override
  public void process(JTextComponent t, DeclarationSet ds) {
    Property p;

    p = caretPosition; if (ds.contains(p)) t.setCaretPosition(ds.getValue(p, Integer.class));
    p = editable; if (ds.contains(p)) t.setEditable(ds.getValue(p, Boolean.class));
    p = margin; if (ds.contains(p)) t.setMargin(ds.getValue(p, Insets.class, SwingFunctions.insets));
    p = text; if (ds.contains(p)) t.setText(ds.getValue(p, String.class));
View Full Code Here

  // -------------------------------------------------------------------------

  public static class Processor implements DeclarationSetProcessor<Button>, ArProperties {
    @Override
    public void process(Button target, DeclarationSet ds) {
      Property p;

      p = stroke; if (ds.contains(p)) target.setStroke(ds.getValue(p, Paint.class));
      p = fill; if (ds.contains(p)) target.setFill(ds.getValue(p, Paint.class));
      p = corderRadius; if (ds.contains(p)) target.setCornerRadius(ds.getValue(p, Integer.class));
      p = strokeThickness; if (ds.contains(p)) target.setStrokeThickness(ds.getValue(p, Integer.class));
View Full Code Here

TOP

Related Classes of aurelienribon.ui.css.Property

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.