📄 helpframe.java
字号:
d = errorLabel.getPreferredSize();
errorLabel.setBounds(x, y, d.width, d.height);
rp.add(errorLabel);
w = w < d.width ? d.width : w;
y += d.height;
final JLabel inOutLabel = createDefaultLabel(startTags + littleBundle.getString("InOutView") + endTags);
d = inOutLabel.getPreferredSize();
inOutLabel.setBounds(x, y, d.width, d.height);
rp.add(inOutLabel);
w = w < d.width ? d.width : w;
y += d.height;
final JLabel procLabel = createDefaultLabel(startTags + littleBundle.getString("ProcessView") + endTags);
d = procLabel.getPreferredSize();
procLabel.setBounds(x, y, d.width, d.height);
rp.add(procLabel);
w = w < d.width ? d.width : w;
y += d.height;
final JLabel procIcon = new JLabel(startTagsSmall + littleBundle.getString("GoUpInProcessViewKey") + endTags,
imgUp, SwingConstants.LEFT);
procIcon.setHorizontalTextPosition(SwingConstants.LEFT);
procIcon.setBackground(Color.white);
procIcon.setOpaque(true);
d = procIcon.getPreferredSize();
procIcon.setBounds(x, y, d.width, d.height);
rp.add(procIcon);
w = w < d.width ? d.width : w;
y += d.height;
final JLabel comLabel = createDefaultLabel(startTags + littleBundle.getString("CommentView") + endTags);
d = comLabel.getPreferredSize();
comLabel.setBounds(x, y, d.width, d.height);
rp.add(comLabel);
w = w < d.width ? d.width : w;
y += d.height;
rp.setBackground(Color.white);
rp.setPreferredSize(new Dimension(w + 2 * x, y + 10));
rightScroll.getViewport().setView(rp);
rightLabel.setText(startTagsLarge + littleBundle.getString("ViewKey") + endTags);
}
/**
* Method drawIconLabel
* @param title
* @param icon
* @return
*/
private JLabel drawIconLabel(String title, ImageIcon icon)
{
final String s = startTags + title + endTag;
final JLabel iLabel = new JLabel(s, icon, SwingConstants.LEFT);
iLabel.setIconTextGap(10);
iLabel.setBackground(Color.white);
iLabel.setOpaque(true);
return iLabel;
}
/**
* Method helpEditing.
*/
void helpEditing()
{
final JPanel rp = new JPanel(null);
final JLabel editLabel = createDefaultLabel(startTags + littleBundle.getString("EditView") + endTags);
final Dimension d = editLabel.getPreferredSize();
editLabel.setBounds(20, 20, d.width, d.height);
rp.add(editLabel);
rp.setBackground(Color.white);
rp.setPreferredSize(new Dimension(d.width + 40, d.height + 40));
rightScroll.getViewport().setView(rp);
rightLabel.setText(startTagsLarge + littleBundle.getString("EditingKey") + endTags);
}
/**
* Method helpValidation.
*/
void helpValidation()
{
final int x = 20;
int y = 20;
int w = 0;
final JPanel rp = new JPanel(null);
final JLabel validLabel = createDefaultLabel(startTags + littleBundle.getString("ValidationView") + endTags);
Dimension d = validLabel.getPreferredSize();
validLabel.setBounds(x, y, d.width, d.height);
rp.add(validLabel);
w = w < d.width ? d.width : w;
y += d.height;
final JLabel validIcon = new JLabel(startTagsSmall + littleBundle.getString("ValidateToolTipKey") + endTags,
imgVal, SwingConstants.LEFT);
validIcon.setHorizontalTextPosition(SwingConstants.LEFT);
validIcon.setBackground(Color.white);
validIcon.setOpaque(true);
d = validIcon.getPreferredSize();
validIcon.setBounds(x, y, d.width, d.height);
rp.add(validIcon);
w = w < d.width ? d.width : w;
y += d.height;
rp.setBackground(Color.white);
rp.setPreferredSize(new Dimension(w + 2 * x, y + 10));
rightScroll.getViewport().setView(rp);
rightLabel.setText(startTagsLarge + littleBundle.getString("ValidationKey") + endTags);
}
/**
* Method helpFurtherDevelopment.
*/
void helpFurtherDevelopment()
{
final JPanel rp = new JPanel(null);
final JLabel devLabel = createDefaultLabel(startTags + littleBundle.getString("FurtherDevView") + endTags);
final Dimension d = devLabel.getPreferredSize();
devLabel.setBounds(20, 20, d.width, d.height);
rp.add(devLabel);
rp.setBackground(Color.white);
rp.setPreferredSize(new Dimension(d.width + 40, d.height + 40));
rightScroll.getViewport().setView(rp);
rightLabel.setText(startTagsLarge + littleBundle.getString("DevelopmentNotesKey") + endTags);
}
/**
* @author ThunellE
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
class LabelMouseListener extends MouseAdapter
{
public void mouseClicked(MouseEvent e)
{
final Cursor defaultCursor = Cursor.getDefaultCursor();
if (e.getSource() == helpLabels[0])
{
helpLabels[0].setCursor(defaultCursor);
helpLabels[0].setText(startTagsSmall + littleBundle.getString("GettingStartedKey") + endTags);
helpGettingStarted();
}
else if (e.getSource() == helpLabels[1])
{
helpLabels[1].setCursor(defaultCursor);
helpLabels[1].setText(startTagsSmall + littleBundle.getString("ViewKey") + endTags);
helpViews();
}
else if (e.getSource() == helpLabels[2])
{
helpLabels[2].setCursor(defaultCursor);
helpLabels[2].setText(startTagsSmall + littleBundle.getString("EditingKey") + endTags);
helpEditing();
}
else if (e.getSource() == helpLabels[3])
{
helpLabels[3].setCursor(defaultCursor);
helpLabels[3].setText(startTagsSmall + littleBundle.getString("ValidationKey") + endTags);
helpValidation();
}
else if (e.getSource() == helpLabels[4])
{
helpLabels[4].setCursor(defaultCursor);
helpLabels[4].setText(startTagsSmall + littleBundle.getString("DevelopmentNotesKey") + endTags);
helpFurtherDevelopment();
}
}
public void mouseEntered(MouseEvent e)
{
final Cursor handCursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
if (e.getSource() == helpLabels[0])
{
helpLabels[0].setCursor(handCursor);
helpLabels[0].setText(startTagsSmallSel + littleBundle.getString("GettingStartedKey") + endTags);
}
else if (e.getSource() == helpLabels[1])
{
helpLabels[1].setCursor(handCursor);
helpLabels[1].setText(startTagsSmallSel + littleBundle.getString("ViewKey") + endTags);
}
else if (e.getSource() == helpLabels[2])
{
helpLabels[2].setCursor(handCursor);
helpLabels[2].setText(startTagsSmallSel + littleBundle.getString("EditingKey") + endTags);
}
else if (e.getSource() == helpLabels[3])
{
helpLabels[3].setCursor(handCursor);
helpLabels[3].setText(startTagsSmallSel + littleBundle.getString("ValidationKey") + endTags);
}
else if (e.getSource() == helpLabels[4])
{
helpLabels[4].setCursor(handCursor);
helpLabels[4].setText(startTagsSmallSel + littleBundle.getString("DevelopmentNotesKey") + endTags);
}
}
public void mouseExited(MouseEvent e)
{
final Cursor defaultCursor = Cursor.getDefaultCursor();
if (e.getSource() == helpLabels[0])
{
helpLabels[0].setCursor(defaultCursor);
helpLabels[0].setText(startTagsSmall + littleBundle.getString("GettingStartedKey") + endTags);
}
else if (e.getSource() == helpLabels[1])
{
helpLabels[1].setCursor(defaultCursor);
helpLabels[1].setText(startTagsSmall + littleBundle.getString("ViewKey") + endTags);
}
else if (e.getSource() == helpLabels[2])
{
helpLabels[2].setCursor(defaultCursor);
helpLabels[2].setText(startTagsSmall + littleBundle.getString("EditingKey") + endTags);
}
else if (e.getSource() == helpLabels[3])
{
helpLabels[3].setCursor(defaultCursor);
helpLabels[3].setText(startTagsSmall + littleBundle.getString("ValidationKey") + endTags);
}
else if (e.getSource() == helpLabels[4])
{
helpLabels[4].setCursor(defaultCursor);
helpLabels[4].setText(startTagsSmall + littleBundle.getString("DevelopmentNotesKey") + endTags);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -