Ejemplo n.º 1
0
  private void setDefaults() {
    setFont(FontFactory.getFont(14));

    setMaximumSize(new Dimension(200, 30));

    setForeground(Configuration.getInstance().getColorConstants().getQLabelForegroundColor());
  }
Ejemplo n.º 2
0
  /** Also used from QPasswordField. */
  public void setDefaults() {
    setBackground(new Color(200, 200, 200));

    setFont(FontFactory.getFont(16));

    setUI(new RoundTextUI());

    UIManager.put("TextField.inactiveForeground", new Color(170, 170, 170));
  }
Ejemplo n.º 3
0
  /*
   * (non-Javadoc)
   *
   * @see javax.swing.plaf.basic.BasicLookAndFeel#initComponentDefaults(javax.swing .UIDefaults)
   */
  @Override
  protected void initComponentDefaults(UIDefaults table) {
    super.initComponentDefaults(table);

    Object[] defaults = {
      "Button.font",
      FontFactory.getFont(14f),
      "Button.background",
      new ColorUIResource(40, 40, 40),
      "Button.foreground",
      new ColorUIResource(200, 200, 200)
    };

    table.putDefaults(defaults);
  }
Ejemplo n.º 4
0
  protected void setDefaults() {
    setLayout(new MigLayout("fill"));

    setFocusable(false);

    setOpaque(false);

    setForeground(new Color(200, 200, 200));

    setContentAreaFilled(false);

    setFont(FontFactory.getFont(14));

    addMouseListener();
  }
Ejemplo n.º 5
0
  /*
   * (non-Javadoc)
   *
   * @see org.quiltplayer.view.components.View#getUI()
   */
  @Override
  public JComponent getUI() {

    panel = new JPanel(new MigLayout("ins 1cm 3cm 0 3cm, center, w 80%!"));
    panel.setOpaque(true);

    JEditorPane htmlPane = null;
    htmlPane =
        new JEditorPane("text/html", content) {

          /*
           * (non-Javadoc)
           *
           * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
           */
          @Override
          protected void paintComponent(Graphics g) {
            Graphics2D g2d = (Graphics2D) g;
            g2d.setRenderingHint(
                RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

            super.paintComponent(g);
          }
        };

    htmlPane.setOpaque(false);
    htmlPane.setDragEnabled(false);
    htmlPane.setEditable(true);
    htmlPane.setFocusable(false);
    htmlPane.setFont(FontFactory.getFont(13));
    htmlPane.setForeground(Color.white);
    htmlPane.setBounds(10, 10, panel.getWidth() - 150, panel.getHeight());

    final Font font = FontFactory.getFont(13);

    String pRule =
        "p { font-family: "
            + font.getName()
            + "; "
            + "font-size: "
            + font.getSize()
            + "pt; color: #EEEEEE; }";
    String spanRule =
        "span { font-family: "
            + font.getName()
            + "; "
            + "font-size: "
            + font.getSize()
            + "pt; color: #FFFFFF; }";
    String linkRule =
        "a { font-family: "
            + font.getName()
            + "; "
            + "font-size: "
            + font.getSize()
            + "pt;"
            + "color: #AAAAAA;}";
    String linkRule2 =
        "a:hoover { text-decoration: none; font-family: "
            + font.getFamily()
            + "; "
            + "font-size: "
            + font.getSize()
            + "pt;"
            + "color: #FFFFFF;}";

    ((HTMLDocument) htmlPane.getDocument()).getStyleSheet().addRule(linkRule);
    ((HTMLDocument) htmlPane.getDocument()).getStyleSheet().addRule(pRule);
    ((HTMLDocument) htmlPane.getDocument()).getStyleSheet().addRule(spanRule);
    ((HTMLDocument) htmlPane.getDocument()).getStyleSheet().addRule(linkRule2);

    StyleSheet styles = ((HTMLDocument) htmlPane.getDocument()).getStyleSheet();

    Enumeration<?> rules = styles.getStyleNames();
    while (rules.hasMoreElements()) {
      String name = (String) rules.nextElement();
      Style rule = styles.getStyle(name);
      System.out.println(rule.toString());
    }

    htmlPane.setCaretPosition(0);

    panel.add(htmlPane, "w 100%, h 100%");

    final QScrollPane pane = new QScrollPane(panel, ScrollDirection.VERTICAL);

    return new JXLayer<JScrollPane>(pane, new JScrollPaneLayerUI());
  }