本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}