当前位置: 首页>>代码示例>>Java>>正文


Java LookAndFeelTweaks.htmlize方法代码示例

本文整理汇总了Java中com.l2fprod.common.swing.LookAndFeelTweaks.htmlize方法的典型用法代码示例。如果您正苦于以下问题:Java LookAndFeelTweaks.htmlize方法的具体用法?Java LookAndFeelTweaks.htmlize怎么用?Java LookAndFeelTweaks.htmlize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.l2fprod.common.swing.LookAndFeelTweaks的用法示例。


在下文中一共展示了LookAndFeelTweaks.htmlize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DemoPanel

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
public DemoPanel() {
  JTaskPane taskPane = new JTaskPane();

  // "System" GROUP
  JTaskPaneGroup systemGroup = new JTaskPaneGroup();
  systemGroup.setTitle(RESOURCE.getString("Main.tasks.systemGroup"));
  systemGroup.setToolTipText(RESOURCE
    .getString("Main.tasks.systemGroup.tooltip"));
  systemGroup.setSpecial(true);
  systemGroup.setIcon(new ImageIcon(TaskPaneMain.class
    .getResource("icons/tasks-email.png")));

  systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.email"), "",
    "icons/tasks-email.png"));
  systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.delete"), "",
    "icons/tasks-recycle.png"));

  taskPane.add(systemGroup);

  // "Office" GROUP
  JTaskPaneGroup officeGroup = new JTaskPaneGroup();
  officeGroup.setTitle(RESOURCE.getString("Main.tasks.office"));
  officeGroup.add(makeAction(RESOURCE.getString("Main.tasks.word"), "",
    "icons/tasks-writedoc.png"));
  officeGroup.setExpanded(false);
  officeGroup.setScrollOnExpand(true);

  taskPane.add(officeGroup);

  // "SEE ALSO" GROUP and ACTIONS
  JTaskPaneGroup seeAlsoGroup = new JTaskPaneGroup();
  seeAlsoGroup.setTitle(RESOURCE.getString("Main.tasks.seealso"));

  seeAlsoGroup.add(makeAction("The Internet", RESOURCE
    .getString("Main.tasks.internet.tooltip"), "icons/tasks-internet.png"));

  seeAlsoGroup.add(makeAction(RESOURCE.getString("Main.tasks.help"),
    RESOURCE.getString("Main.tasks.help.tooltip"),
    "icons/tasks-question.png"));

  taskPane.add(seeAlsoGroup);

  // "Details" GROUP
  JTaskPaneGroup detailsGroup = new JTaskPaneGroup();
  detailsGroup.setTitle(RESOURCE.getString("Main.tasks.details"));
  detailsGroup.setScrollOnExpand(true);

  JEditorPane detailsText = new JEditorPane("text/html", "<html>");
  LookAndFeelTweaks.makeMultilineLabel(detailsText);
  LookAndFeelTweaks.htmlize(detailsText);
  detailsText.setText(RESOURCE.getString("Main.tasks.details.message"));
  detailsGroup.add(detailsText);

  taskPane.add(detailsGroup);

  JScrollPane scroll = new JScrollPane(taskPane);
  scroll.setBorder(null);

  setLayout(new BorderLayout());
  add("Center", scroll);
  
  setBorder(null);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:64,代码来源:TaskPaneMain.java

示例2: buildUI

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
private void buildUI() {
  LookAndFeelTweaks.setBorderLayout(this);
  LookAndFeelTweaks.setBorder(this);

  actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0));
  actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
  add("North", actionPanel);

  sortButton = new JToggleButton(new ToggleSortingAction());
  sortButton.setUI(new BlueishButtonUI());
  sortButton.setText(null);
  actionPanel.add(sortButton);

  asCategoryButton = new JToggleButton(new ToggleModeAction());
  asCategoryButton.setUI(new BlueishButtonUI());
  asCategoryButton.setText(null);
  actionPanel.add(asCategoryButton);

  descriptionButton = new JToggleButton(new ToggleDescriptionAction());
  descriptionButton.setUI(new BlueishButtonUI());
  descriptionButton.setText(null);
  actionPanel.add(descriptionButton);

  split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  split.setBorder(null);
  split.setResizeWeight(1.0);
  split.setContinuousLayout(true);
  add("Center", split);
  
  tableScroll = new JScrollPane();
  split.setTopComponent(tableScroll);

  descriptionPanel = new JEditorPane("text/html", "<html>");
  descriptionPanel.setBorder(BorderFactory.createEmptyBorder());
  descriptionPanel.setEditable(false);
  descriptionPanel.setBackground(UIManager.getColor("Panel.background"));
  LookAndFeelTweaks.htmlize(descriptionPanel);

  selectionListener = new SelectionListener();

  descriptionScrollPane = new JScrollPane(descriptionPanel);
  descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory
    .createLineBorder(UIManager.getColor("controlDkShadow"))));
  descriptionScrollPane.getViewport().setBackground(
    descriptionPanel.getBackground());
  descriptionScrollPane.setMinimumSize(new Dimension(50, 50));
  split.setBottomComponent(descriptionScrollPane);
  
  // by default description is not visible, toolbar is visible.
  setDescriptionVisible(false);
  setToolBarVisible(true);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:53,代码来源:PropertySheetPanel.java

示例3: showCurrentTip

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
protected void showCurrentTip() {
  if (currentTipComponent != null) {
    tipArea.remove(currentTipComponent);
  }

  int currentTip = tipPane.getCurrentTip();
  if (currentTip == -1) {
    JLabel label = new JLabel();
    label.setOpaque(true);
    label.setBackground(UIManager.getColor("TextArea.background"));
    currentTipComponent = label;
    tipArea.add("Center", currentTipComponent);
    return;
  }

  // tip does not fall in current tip range
  if (tipPane.getModel().getTipCount() == 0
    || (currentTip < 0 && currentTip >= tipPane.getModel().getTipCount())) {
    currentTipComponent = new JLabel();
  } else {    
    Tip tip = tipPane.getModel().getTipAt(currentTip);

    Object tipObject = tip.getTip();
    if (tipObject instanceof Component) {
      currentTipComponent = (Component)tipObject;
    } else if (tipObject instanceof Icon) {
      currentTipComponent = new JLabel((Icon)tipObject);
    } else {
      JScrollPane tipScroll = new JScrollPane();
      tipScroll.setBorder(null);
      tipScroll.setOpaque(false);
      tipScroll.getViewport().setOpaque(false);
      tipScroll.setBorder(null);

      String text = tipObject == null?"":tipObject.toString();

      if (text.toLowerCase().startsWith("<html>")) {
        JEditorPane editor = new JEditorPane("text/html", text);
        LookAndFeelTweaks.htmlize(editor, tipPane.getFont());
        editor.setEditable(false);
        editor.setBorder(null);
        editor.setMargin(null);
        editor.setOpaque(false);
        tipScroll.getViewport().setView(editor);
      } else {
        JTextArea area = new JTextArea(text);
        area.setFont(tipPane.getFont());
        area.setEditable(false);
        area.setLineWrap(true);
        area.setWrapStyleWord(true);
        area.setBorder(null);
        area.setMargin(null);
        area.setOpaque(false);
        tipScroll.getViewport().setView(area);
      }

      currentTipComponent = tipScroll;
    }
  }
  
  tipArea.add("Center", currentTipComponent);
  tipArea.revalidate();
  tipArea.repaint();
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:65,代码来源:BasicTipOfTheDayUI.java

示例4: buildUI

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
private void buildUI() {
  LookAndFeelTweaks.setBorderLayout(this);
  LookAndFeelTweaks.setBorder(this);

  actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0));
  actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
  actionPanel.setOpaque(false);
  add("North", actionPanel);

  sortButton = new JToggleButton(new ToggleSortingAction());
  sortButton.setUI(new BlueishButtonUI());
  sortButton.setText(null);
  sortButton.setOpaque(false);
  actionPanel.add(sortButton);

  asCategoryButton = new JToggleButton(new ToggleModeAction());
  asCategoryButton.setUI(new BlueishButtonUI());
  asCategoryButton.setText(null);
  asCategoryButton.setOpaque(false);
  actionPanel.add(asCategoryButton);

  descriptionButton = new JToggleButton(new ToggleDescriptionAction());
  descriptionButton.setUI(new BlueishButtonUI());
  descriptionButton.setText(null);
  descriptionButton.setOpaque(false);
  actionPanel.add(descriptionButton);

  split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  split.setBorder(null);
  split.setResizeWeight(1.0);
  split.setContinuousLayout(true);
  add("Center", split);

  tableScroll = new JScrollPane();
  tableScroll.setBorder(BorderFactory.createEmptyBorder());
  split.setTopComponent(tableScroll);

  descriptionPanel = new JEditorPane("text/html", "<html>");
  descriptionPanel.setBorder(BorderFactory.createEmptyBorder());
  descriptionPanel.setEditable(false);
  descriptionPanel.setBackground(UIManager.getColor("Panel.background"));
  LookAndFeelTweaks.htmlize(descriptionPanel);

  selectionListener = new SelectionListener();

  descriptionScrollPane = new JScrollPane(descriptionPanel);
  descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory.createLineBorder(UIManager.getColor("controlDkShadow"))));
  descriptionScrollPane.getViewport().setBackground(descriptionPanel.getBackground());
  descriptionScrollPane.setMinimumSize(new Dimension(50, 50));
  split.setBottomComponent(descriptionScrollPane);

  // by default description is not visible, toolbar is visible.
  setDescriptionVisible(false);
  setToolBarVisible(true);
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:56,代码来源:PropertySheetPanel.java

示例5: showCurrentTip

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
protected void showCurrentTip() {
  if (currentTipComponent != null) {
    tipArea.remove(currentTipComponent);
  }

  int currentTip = tipPane.getCurrentTip();
  if (currentTip == -1) {
    JLabel label = new JLabel();
    label.setOpaque(true);
    label.setBackground(UIManager.getColor("TextArea.background"));
    currentTipComponent = label;
    tipArea.add("Center", currentTipComponent);
    return;
  }

  // tip does not fall in current tip range
  if (tipPane.getModel().getTipCount() == 0 || (currentTip < 0 && currentTip >= tipPane.getModel().getTipCount())) {
    currentTipComponent = new JLabel();
  } else {
    Tip tip = tipPane.getModel().getTipAt(currentTip);

    Object tipObject = tip.getTip();
    if (tipObject instanceof Component) {
      currentTipComponent = (Component) tipObject;
    } else if (tipObject instanceof Icon) {
      currentTipComponent = new JLabel((Icon) tipObject);
    } else {
      JScrollPane tipScroll = new JScrollPane();
      tipScroll.setBorder(null);
      tipScroll.setOpaque(false);
      tipScroll.getViewport().setOpaque(false);
      tipScroll.setBorder(null);

      String text = tipObject == null ? "" : tipObject.toString();

      if (text.toLowerCase().startsWith("<html>")) {
        JEditorPane editor = new JEditorPane("text/html", text);
        LookAndFeelTweaks.htmlize(editor, tipPane.getFont());
        editor.setEditable(false);
        editor.setBorder(null);
        editor.setMargin(null);
        editor.setOpaque(false);
        tipScroll.getViewport().setView(editor);
      } else {
        JTextArea area = new JTextArea(text);
        area.setFont(tipPane.getFont());
        area.setEditable(false);
        area.setLineWrap(true);
        area.setWrapStyleWord(true);
        area.setBorder(null);
        area.setMargin(null);
        area.setOpaque(false);
        tipScroll.getViewport().setView(area);
      }

      currentTipComponent = tipScroll;
    }
  }

  tipArea.add("Center", currentTipComponent);
  tipArea.revalidate();
  tipArea.repaint();
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:64,代码来源:BasicTipOfTheDayUI.java

示例6: buildUI

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
private void buildUI() {
    LookAndFeelTweaks.setBorderLayout(this);
    LookAndFeelTweaks.setBorder(this);

    actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0));
    actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
    actionPanel.setOpaque(false);
    add("North", actionPanel);

    sortButton = new JToggleButton(new ToggleSortingAction());
    sortButton.setUI(new BlueishButtonUI());
    sortButton.setText(null);
    sortButton.setOpaque(false);
    actionPanel.add(sortButton);

    asCategoryButton = new JToggleButton(new ToggleModeAction());
    asCategoryButton.setUI(new BlueishButtonUI());
    asCategoryButton.setText(null);
    asCategoryButton.setOpaque(false);
    actionPanel.add(asCategoryButton);

    descriptionButton = new JToggleButton(new ToggleDescriptionAction());
    descriptionButton.setUI(new BlueishButtonUI());
    descriptionButton.setText(null);
    descriptionButton.setOpaque(false);
    actionPanel.add(descriptionButton);

    split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    split.setBorder(null);
    split.setResizeWeight(1.0);
    split.setContinuousLayout(true);
    add("Center", split);

    tableScroll = new JScrollPane();
    tableScroll.setBorder(BorderFactory.createEmptyBorder());
    split.setTopComponent(tableScroll);

    descriptionPanel = new JEditorPane("text/html", "<html>");
    descriptionPanel.setBorder(BorderFactory.createEmptyBorder());
    descriptionPanel.setEditable(false);
    descriptionPanel.setBackground(UIManager.getColor("Panel.background"));
    LookAndFeelTweaks.htmlize(descriptionPanel);

    selectionListener = new SelectionListener();

    descriptionScrollPane = new JScrollPane(descriptionPanel);
    descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory
            .createLineBorder(UIManager.getColor("controlDkShadow"))));
    descriptionScrollPane.getViewport().setBackground(
            descriptionPanel.getBackground());
    descriptionScrollPane.setMinimumSize(new Dimension(50, 50));
    split.setBottomComponent(descriptionScrollPane);

    // by default description is not visible, toolbar is visible.
    setDescriptionVisible(false);
    setToolBarVisible(true);
}
 
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:58,代码来源:PropertySheetPanel.java

示例7: buildUI

import com.l2fprod.common.swing.LookAndFeelTweaks; //导入方法依赖的package包/类
private void buildUI() {
  LookAndFeelTweaks.setBorderLayout(this);
  LookAndFeelTweaks.setBorder(this);

  actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0));
  actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
  actionPanel.setOpaque(false);
  add("North", actionPanel);

  sortButton = new JToggleButton(new ToggleSortingAction());
  sortButton.setUI(new BlueishButtonUI());
  sortButton.setText(null);
  sortButton.setOpaque(false);
  actionPanel.add(sortButton);

  asCategoryButton = new JToggleButton(new ToggleModeAction());
  asCategoryButton.setUI(new BlueishButtonUI());
  asCategoryButton.setText(null);
  asCategoryButton.setOpaque(false);
  actionPanel.add(asCategoryButton);

  descriptionButton = new JToggleButton(new ToggleDescriptionAction());
  descriptionButton.setUI(new BlueishButtonUI());
  descriptionButton.setText(null);
  descriptionButton.setOpaque(false);
  actionPanel.add(descriptionButton);

  split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  split.setBorder(null);
  split.setResizeWeight(1.0);
  split.setContinuousLayout(true);
  add("Center", split);
  
  tableScroll = new JScrollPane();
  tableScroll.setBorder(BorderFactory.createEmptyBorder());
  split.setTopComponent(tableScroll);

  descriptionPanel = new JEditorPane("text/html", "<html>");
  descriptionPanel.setBorder(BorderFactory.createEmptyBorder());
  descriptionPanel.setEditable(false);
  descriptionPanel.setBackground(UIManager.getColor("Panel.background"));
  LookAndFeelTweaks.htmlize(descriptionPanel);

  selectionListener = new SelectionListener();

  descriptionScrollPane = new JScrollPane(descriptionPanel);
  descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory
    .createLineBorder(UIManager.getColor("controlDkShadow"))));
  descriptionScrollPane.getViewport().setBackground(
    descriptionPanel.getBackground());
  descriptionScrollPane.setMinimumSize(new Dimension(50, 50));
  split.setBottomComponent(descriptionScrollPane);
  
  // by default description is not visible, toolbar is visible.
  setDescriptionVisible(false);
  setToolBarVisible(true);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:58,代码来源:PropertySheetPanel.java


注:本文中的com.l2fprod.common.swing.LookAndFeelTweaks.htmlize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。