本文整理汇总了Python中javax.swing.JLabel.getFont方法的典型用法代码示例。如果您正苦于以下问题:Python JLabel.getFont方法的具体用法?Python JLabel.getFont怎么用?Python JLabel.getFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JLabel
的用法示例。
在下文中一共展示了JLabel.getFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JLabel [as 别名]
# 或者: from javax.swing.JLabel import getFont [as 别名]
#.........这里部分代码省略.........
manualPane.add(Box.createHorizontalGlue())
manualPane.add(self.bboxTextField)
group = ButtonGroup()
group.add(self.captureRBtn)
group.add(self.manualRBtn)
previewPane = JPanel()
previewPane.setLayout(BoxLayout(previewPane, BoxLayout.X_AXIS))
previewPane.setAlignmentX(Component.LEFT_ALIGNMENT)
bboxPreviewInfo = JTextField(self.app.strings.getString("coordinates"),
editable=0,
border=None)
bboxPreviewInfo.setMaximumSize(bboxPreviewInfo.getPreferredSize())
self.bboxPreviewTextField = JTextField(20,
editable=0,
border=None)
self.bboxPreviewTextField.setMaximumSize(self.bboxPreviewTextField.getPreferredSize())
previewPane.add(bboxPreviewInfo)
previewPane.add(Box.createHorizontalGlue())
previewPane.add(self.bboxPreviewTextField)
self.rectPanel.add(capturePane)
self.rectPanel.add(Box.createRigidArea(Dimension(0, 10)))
self.rectPanel.add(manualPane)
self.rectPanel.add(Box.createRigidArea(Dimension(0, 20)))
self.rectPanel.add(previewPane)
#- Polygon (closed way) drawn by hand
self.polygonPanel = JPanel(BorderLayout())
self.polygonPanel.setLayout(BoxLayout(self.polygonPanel, BoxLayout.Y_AXIS))
polyInfo = JLabel("<html>%s</html>" % self.app.strings.getString("polygon_info"))
polyInfo.setFont(polyInfo.getFont().deriveFont(Font.ITALIC))
polyInfo.setAlignmentX(Component.LEFT_ALIGNMENT)
editPolyPane = JPanel()
editPolyPane.setAlignmentX(Component.LEFT_ALIGNMENT)
editPolyBtn = JButton(self.app.strings.getString("create_fav_layer"),
actionPerformed=self.create_new_zone_editing_layer)
editPolyBtn.setToolTipText(self.app.strings.getString("create_fav_layer_tooltip"))
editPolyPane.add(editPolyBtn)
self.polygonPanel.add(polyInfo)
self.polygonPanel.add(Box.createRigidArea(Dimension(0, 15)))
self.polygonPanel.add(editPolyPane)
self.polygonPanel.add(Box.createRigidArea(Dimension(0, 15)))
#- Administrative Boundary
self.boundaryPanel = JPanel()
self.boundaryPanel.setLayout(BoxLayout(self.boundaryPanel, BoxLayout.Y_AXIS))
boundaryInfo = JLabel("<html>%s</html>" % app.strings.getString("boundary_info"))
boundaryInfo.setFont(boundaryInfo.getFont().deriveFont(Font.ITALIC))
boundaryInfo.setAlignmentX(Component.LEFT_ALIGNMENT)
boundaryTagsPanel = JPanel(GridLayout(3, 3, 5, 5))
boundaryTagsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
boundaryTagsPanel.add(JLabel("name ="))
self.nameTagTextField = JTextField(20)
boundaryTagsPanel.add(self.nameTagTextField)
boundaryTagsPanel.add(JLabel("admin_level ="))
self.adminLevelTagTextField = JTextField(20)
self.adminLevelTagTextField.setToolTipText(self.app.strings.getString("adminLevel_tooltip"))
boundaryTagsPanel.add(self.adminLevelTagTextField)
boundaryTagsPanel.add(JLabel(self.app.strings.getString("other_tag")))
示例2: __init__
# 需要导入模块: from javax.swing import JLabel [as 别名]
# 或者: from javax.swing.JLabel import getFont [as 别名]
def __init__(self, parent, title, app):
from javax.swing import JCheckBox, JRadioButton, ButtonGroup
self.app = app
border = BorderFactory.createEmptyBorder(5, 7, 5, 7)
self.getContentPane().setBorder(border)
self.getContentPane().setLayout(BorderLayout(0, 5))
self.tabbedPane = JTabbedPane()
#1 Tab: general
panel1 = JPanel()
panel1.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
panel1.setLayout(BoxLayout(panel1, BoxLayout.PAGE_AXIS))
#Checkbutton to enable/disable update check when script starts
self.updateCBtn = JCheckBox(self.app.strings.getString("updateCBtn"))
self.updateCBtn.setToolTipText(self.app.strings.getString("updateCBtn_tooltip"))
#Download tools
downloadBtn = JButton(self.app.strings.getString("updatesBtn"),
ImageProvider.get("dialogs", "refresh"),
actionPerformed=self.on_downloadBtn_clicked)
downloadBtn.setToolTipText(self.app.strings.getString("updatesBtn_tooltip"))
#Checkbuttons for enabling/disabling tools
toolsPanel = JPanel(BorderLayout(0, 5))
title = self.app.strings.getString("enable_disable_tools")
toolsPanel.setBorder(BorderFactory.createTitledBorder(title))
infoLbl = JLabel(self.app.strings.getString("JOSM_restart_warning"))
infoLbl.setFont(infoLbl.getFont().deriveFont(Font.ITALIC))
toolsPanel.add(infoLbl, BorderLayout.PAGE_START)
toolsStatusPane = JPanel(GridLayout(len(self.app.realTools), 0))
self.toolsCBtns = []
for tool in self.app.realTools:
toolCBtn = JCheckBox()
toolCBtn.addItemListener(self)
toolLbl = JLabel(tool.title, tool.bigIcon, JLabel.LEFT)
self.toolsCBtns.append(toolCBtn)
toolPane = JPanel()
toolPane.setLayout(BoxLayout(toolPane, BoxLayout.X_AXIS))
toolPane.add(toolCBtn)
toolPane.add(toolLbl)
toolsStatusPane.add(toolPane)
toolsPanel.add(toolsStatusPane, BorderLayout.CENTER)
#Radiobuttons for enabling/disabling layers when a new one
#is added
layersPanel = JPanel(GridLayout(0, 1))
title = self.app.strings.getString("errors_layers_manager")
layersPanel.setBorder(BorderFactory.createTitledBorder(title))
errorLayersLbl = JLabel(self.app.strings.getString("errors_layers_info"))
errorLayersLbl.setFont(errorLayersLbl.getFont().deriveFont(Font.ITALIC))
layersPanel.add(errorLayersLbl)
self.layersRBtns = {}
group = ButtonGroup()
for mode in self.app.layersModes:
layerRBtn = JRadioButton(self.app.strings.getString("%s" % mode))
group.add(layerRBtn)
layersPanel.add(layerRBtn)
self.layersRBtns[mode] = layerRBtn
#Max number of errors text field
self.maxErrorsNumberTextField = JTextField()
self.maxErrorsNumberTextField.setToolTipText(self.app.strings.getString("maxErrorsNumberTextField_tooltip"))
self.maxErrorsNumberTFieldDefaultBorder = self.maxErrorsNumberTextField.getBorder()
self.maxErrorsNumberTextField.getDocument().addDocumentListener(ErrNumTextListener(self))
#layout
self.updateCBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(self.updateCBtn)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
downloadBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(downloadBtn)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
toolsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(toolsPanel)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
layersPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(layersPanel)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
maxErrP = JPanel(BorderLayout(5, 0))
maxErrP.add(JLabel(self.app.strings.getString("max_errors_number")), BorderLayout.LINE_START)
maxErrP.add(self.maxErrorsNumberTextField, BorderLayout.CENTER)
p = JPanel(BorderLayout())
p.add(maxErrP, BorderLayout.PAGE_START)
p.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(p)
self.tabbedPane.addTab(self.app.strings.getString("tab_1_title"),
None,
panel1,
None)
#2 Tab: favourite zones
panel2 = JPanel(BorderLayout(5, 15))
panel2.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
#status
topPanel = JPanel()
#.........这里部分代码省略.........