本文整理匯總了Python中javax.swing.JScrollPane.setPreferredSize方法的典型用法代碼示例。如果您正苦於以下問題:Python JScrollPane.setPreferredSize方法的具體用法?Python JScrollPane.setPreferredSize怎麽用?Python JScrollPane.setPreferredSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setPreferredSize方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self, controller):
'''
Creates default empty text area in a panel.
It will contain the ATF file content, and allow text edition.
It should highlight reserved words and suggest autocompletion or
possible typos, a la IDEs like Eclipse.
It might need refactoring so that there is a parent panel with two modes
or contexts, depending on user choice: text view or model view.
'''
#Give reference to controller to delegate action response
self.controller = controller
#Make text area occupy all available space and resize with parent window
self.setLayout(BorderLayout())
#Create text edition area
self.editArea = JTextArea()
self.editArea.border = BorderFactory.createEmptyBorder(4,4,4,4)
self.editArea.font = Font("Monaco", Font.PLAIN, 14)
#Will need scrolling controls
scrollingText = JScrollPane(self.editArea)
scrollingText.setPreferredSize(Dimension(1,500))
#Add to parent panel
self.add(scrollingText, BorderLayout.CENTER)
示例2: p_build_ui
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def p_build_ui(self, event):
"""
Adds a list of checkboxes, one for each loaded plugin
to the Selct plugins window
"""
if not self.loaded_p_list:
self.update_scroll("[!!] No plugins loaded!")
return
scroll_pane = JScrollPane()
scroll_pane.setPreferredSize(Dimension(200, 250))
check_frame = JPanel(GridBagLayout())
constraints = GridBagConstraints()
constraints.fill = GridBagConstraints.HORIZONTAL
constraints.gridy = 0
constraints.anchor = GridBagConstraints.FIRST_LINE_START
for plug in self.loaded_p_list:
check_frame.add(JCheckBox(plug.get_name(), plug.enabled,
actionPerformed=self.update_box),
constraints)
constraints.gridy += 1
vport = JViewport()
vport.setView(check_frame)
scroll_pane.setViewport(vport)
self.window.contentPane.add(scroll_pane)
self.window.pack()
self.window.setVisible(True)
示例3: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self, controller):
'''
Creates default empty console-looking panel.
It should be separated from the rest of the GUI so that users can choose
to show or hide the console. Or should it be a split panel?
This panel will display log and validation/lemmatization messages.
It might need its own toolbar for searching, etc.
It will also accept commands in later stages of development, if need be.
'''
#Give reference to controller to delegate action response
self.controller = controller
#Make text area occupy all available space and resize with parent window
self.setLayout(BorderLayout())
#Create console-looking area
self.editArea = JTextArea()
self.editArea.border = BorderFactory.createEmptyBorder(4,4,4,4)
self.editArea.font = Font("Courier New", Font.BOLD, 14)
self.editArea.background = Color.BLACK
self.editArea.foreground = Color.WHITE
self.editArea.text = "Console started. Nammu's log will appear here.\n\n"
#Will need scrolling controls
scrollingText = JScrollPane(self.editArea)
scrollingText.setPreferredSize(Dimension(1,150))
#Make text area auto scroll down to last printed line
caret = self.editArea.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
#Add to parent panel
self.add(scrollingText, BorderLayout.CENTER)
示例4: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self):
# Panel for Measurements
self.setLayout(BorderLayout())
# PAGE_START
''' show group/dataset names in the list (component/variable) names '''
self.cbfilemeasOut = JComboBox([])
bfilemeasOut= JButton('Measurements', actionPerformed= self.loadMeasOut)
p3= JPanel()
p3.setLayout(GridLayout(1,2))
p3.add(self.cbfilemeasOut)
p3.add(bfilemeasOut)
self.add(p3, BorderLayout.PAGE_START)
# LINE_START
root = DefaultMutableTreeNode('VarMeasurements')
self.tree = JTree(root)
scrollPane = JScrollPane() # add a scrollbar to the viewport
scrollPane.setPreferredSize(Dimension(230,320))
scrollPane.getViewport().setView((self.tree))
p4 = JPanel()
p4.add(scrollPane)
self.add(p4, BorderLayout.LINE_START)
# CENTER
''' represent a signal with matplot lib in textarea places '''
graficMeas= JTextArea()
self.add(graficMeas, BorderLayout.CENTER)
示例5: createList
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def createList(self, content):
model = DefaultListModel()
for elem in content:
model.addElement(elem)
list = JList(model)
listPane = JScrollPane(list)
listPane.setPreferredSize(Dimension(250, 400))
return listPane, list, model
示例6: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self, controller):
'''
Creates default empty console-looking panel.
It should be separated from the rest of the GUI so that users can
choose to show or hide the console. Or should it be a split panel?
This panel will display log and validation/lemmatization messages.
It might need its own toolbar for searching, etc.
It will also accept commands in later stages of development, if need
be.
'''
# Give reference to controller to delegate action response
self.controller = controller
# Make text area occupy all available space and resize with parent
# window
self.setLayout(BorderLayout())
# Create console-looking area
self.edit_area = JEditorPane()
# Although most of the styling is done using css, we need to set these
# properties to ensure the html is rendered properly in the console
self.edit_area.border = BorderFactory.createEmptyBorder(6, 6, 6, 6)
self.edit_area.setContentType("text/html")
# Disable writing in the console - required to render hyperlinks
self.edit_area.setEditable(False)
# Map CSS color strings to Java Color objects
self.colors = {'Gray': Color(238, 238, 238),
'Black': Color(0, 0, 0),
'Yellow': Color(255, 255, 0)}
# Initial call to refresh console to set the console style properties
self.refreshConsole()
# Set up a hyperlink listener
listener = addEventListener(self.edit_area, HyperlinkListener,
'hyperlinkUpdate', self.handleEvent)
# Will need scrolling controls
scrollingText = JScrollPane(self.edit_area)
scrollingText.setPreferredSize(Dimension(1, 150))
# Make text area auto scroll down to last printed line
caret = self.edit_area.getCaret()
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE)
# Add to parent panel
self.add(scrollingText, BorderLayout.CENTER)
示例7: getContentPane
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def getContentPane():
global contentPane
global devicesList
global devicesPanel
if not contentPane:
global devicesListLabel
devicesListLabel = JLabel("Devices")
global devicesList
devicesList = JList([])
devicesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION)
listScroller = JScrollPane(devicesList)
listScroller.setPreferredSize(Dimension(600, 400))
global connectButton
global focusButton
allDevsButton = JButton(ALL_DEVICES, actionPerformed=handleAllDevsBtn)
connectedDevsButton = JButton(CONNECTED_DEVICES,
actionPerformed=handleConnectedDevBtn)
connectButton = JButton(CONNECT, actionPerformed=handleConnectBtn)
focusButton = JButton(FOCUS, actionPerformed=handleFocusBtn)
focusButton.setVisible(False)
goInButton = JButton("Go in device", actionPerformed=handleGoInBtn)
deviceListButtons = JPanel()
deviceListButtons.add(allDevsButton)
deviceListButtons.add(connectedDevsButton)
deviceListButtons.add(connectButton)
deviceListButtons.add(focusButton)
deviceListButtons.add(goInButton)
devicesPanel = JPanel()
devicesPanel.setLayout(BoxLayout(devicesPanel, BoxLayout.Y_AXIS))
devicesPanel.add(devicesListLabel)
devicesPanel.add(listScroller)
devicesPanel.add(deviceListButtons)
contentPane = JPanel()
contentPane.setLayout(BorderLayout())
contentPane.add(devicesPanel, BorderLayout.WEST)
contentPane.add(getControlPanel(), BorderLayout.EAST)
contentPane.add(getScreenPanel(), BorderLayout.CENTER)
getScreenPanel().setVisible(False)
return contentPane
示例8: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self):
frame = JFrame("Jython JTable Example")
frame.setSize(500, 250)
frame.setLayout(BorderLayout())
self.tableData = [
['Mouse 1', eventNames[0], eventScriptType[0]],
['Mouse 2', eventNames[1] , eventScriptType[1]],
['Mouse 3', eventNames[2], eventScriptType[2]],
['Mouse 1 Shift', eventNames[3], eventScriptType[3]],
['Mouse 2 Shift',eventNames[4], eventScriptType[4]],
['Mouse 3 Shift',eventNames[5], eventScriptType[5]],
['Mouse 1 Control',eventNames[6], eventScriptType[6]],
['Mouse 2 Control',eventNames[7], eventScriptType[7]],
['Mouse 3 Control',eventNames[8], eventScriptType[8]],
]
colNames = ('Script/Event','Name','Type')
dataModel = DefaultTableModel(self.tableData, colNames)
self.table = JTable(dataModel)
scrollPane = JScrollPane()
scrollPane.setPreferredSize(Dimension(400,200))
scrollPane.getViewport().setView((self.table))
panel = JPanel()
panel.add(scrollPane)
frame.add(panel, BorderLayout.CENTER)
self.label = JLabel('Hello from Jython')
frame.add(self.label, BorderLayout.NORTH)
button = JButton('Save Settings',actionPerformed=self.setText)
frame.add(button, BorderLayout.SOUTH)
exitButton = JButton('Exit',actionPerformed=self.myExit)
frame.add(exitButton, BorderLayout.EAST)
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE)
frame.setVisible(True)
示例9: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self, title=""):
JFrame.__init__(self, title)
self.size = 400,500
self.windowClosing = self.closing
label = JLabel(text="Class Name:")
label.horizontalAlignment = JLabel.RIGHT
tpanel = JPanel(layout = awt.FlowLayout())
self.text = JTextField(20, actionPerformed = self.entered)
btn = JButton("Enter", actionPerformed = self.entered)
tpanel.add(label)
tpanel.add(self.text)
tpanel.add(btn)
bpanel = JPanel()
self.tree = JTree(default_tree())
scrollpane = JScrollPane(self.tree)
scrollpane.setMinimumSize(awt.Dimension(200,200))
scrollpane.setPreferredSize(awt.Dimension(350,400))
bpanel.add(scrollpane)
bag = GridBag(self.contentPane)
bag.addRow(tpanel, fill='HORIZONTAL', weightx=1.0, weighty=0.5)
bag.addRow(bpanel, fill='BOTH', weightx=0.5, weighty=1.0)
示例10: openGUI
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
#.........這裏部分代碼省略.........
# Main window title placed at the top of the main window with an invisible bottom border
titlePanel = JPanel()
titleBorder = BorderFactory.createEmptyBorder(0, 0, 10, 0)
title = JLabel("Directory Listing Parser for Burp Suite", JLabel.CENTER)
title.setBorder(titleBorder)
title.setFont(Font("Default", Font.PLAIN, 18))
titlePanel.add(title)
self.window.contentPane.add("North", titlePanel)
# Left panel for user input, consisting of hostname, directory prefix, ssl, port, type of listing, and file
self.leftPanel = JPanel()
self.leftPanel.layout = GridLayout(14, 1, 3, 3)
hostnameLabel = JLabel("Hostname:")
if self.originalMsgHost:
self.hostnameTextField = JTextField(self.originalMsgHost.rstrip())
else:
self.hostnameTextField = JTextField('Hostname')
dirPrefixLabel = JLabel("Full Directory Prefix (Windows):")
self.dirPrefixField = JTextField('C:\\var\www\\')
sslLabel = JLabel("SSL:")
self.radioBtnSslEnabled = JRadioButton('Enabled (https)', actionPerformed=self.radioSsl)
self.radioBtnSslDisabled = JRadioButton('Disabled (http)', actionPerformed=self.radioSsl)
sslButtonGroup = ButtonGroup()
sslButtonGroup.add(self.radioBtnSslEnabled)
sslButtonGroup.add(self.radioBtnSslDisabled)
if self.originalMsgProtocol == "https":
self.radioBtnSslEnabled.setSelected(True)
else:
self.radioBtnSslDisabled.setSelected(True)
portLabel = JLabel("Port:")
if self.originalMsgPort:
self.portTextField = JTextField(str(self.originalMsgPort).rstrip())
else:
self.portTextField = JTextField('80')
osLabel = JLabel("Type of File Listing:")
self.types = ('Windows \'dir /s\'', 'Linux \'ls -lR\'', 'Linux \'ls -R\'')
self.comboListingType = JComboBox(self.types)
uploadLabel = JLabel("Directory Listing File:")
self.uploadTextField = JTextField('')
uploadButton = JButton('Choose File', actionPerformed=self.chooseFile)
self.leftPanel.add(hostnameLabel)
self.leftPanel.add(self.hostnameTextField)
self.leftPanel.add(dirPrefixLabel)
self.leftPanel.add(self.dirPrefixField)
self.leftPanel.add(sslLabel)
self.leftPanel.add(self.radioBtnSslEnabled)
self.leftPanel.add(self.radioBtnSslDisabled)
self.leftPanel.add(portLabel)
self.leftPanel.add(self.portTextField)
self.leftPanel.add(osLabel)
self.leftPanel.add(self.comboListingType)
self.leftPanel.add(uploadLabel)
self.leftPanel.add(self.uploadTextField)
self.leftPanel.add(uploadButton)
# Right panel consisting of a text area for the URL list
self.UrlPanelLabel = JLabel("URL List:")
self.textArea = JTextArea()
self.textArea.setEditable(True)
self.textArea.setFont(Font("Default", Font.PLAIN, 14))
if self.cookies:
self.textArea.append('Cookies Found:\n')
for cookie in self.cookies:
if cookie.getDomain() in self.originalMsgHost:
self.cookie += cookie.getName() + '=' + cookie.getValue() + '; '
self.textArea.append(cookie.getName() + '=' + cookie.getValue() + '\n')
scrollArea = JScrollPane(self.textArea)
scrollArea.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS)
scrollArea.setPreferredSize(Dimension(400, 200))
self.rightPanel = JPanel()
self.rightPanel.setLayout(BorderLayout(3, 3))
self.rightPanel.add(self.UrlPanelLabel, BorderLayout.NORTH)
self.rightPanel.add(scrollArea, BorderLayout.CENTER)
# Panel for the generate URL list and import URL list buttons
generatePanel = JPanel()
generatePanel.layout = BorderLayout(3, 3)
generateButton = JButton('Generate URL List', actionPerformed=self.generateUrlList)
importButton = JButton('Import URL List to Burp Site Map', actionPerformed=self.confirmImport)
generatePanel.add("North", generateButton)
generatePanel.add("South", importButton)
self.rightPanel.add("South", generatePanel)
# Add the two main panels to the left and right sides
self.window.contentPane.add("East", self.rightPanel)
self.window.contentPane.add("West", self.leftPanel)
# Create a panel to be used for the file chooser window
self.uploadPanel = JPanel()
self.window.pack()
self.window.show()
開發者ID:LucaBongiorni,項目名稱:Directory-File-Listing-Parser-Importer,代碼行數:104,代碼來源:Directory-File-Listing-Parser-Importer.py
示例11: ChatClient
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
class ChatClient(JFrame):
## Constructor method, receives the variables from the ChatApp class as parameters
def __init__(self, name, greeting, tn):
'''Constructor, initialises base class & assigns variables
'''
# Call to the super method to take care of the base class(es)
super(ChatClient, self).__init__()
# Assign the relevent variable names
self.username=name
self.greeting=greeting
self.tn = tn
self.no_users=[]
# Initiate the Threaded function for receiving messages
t1=Thread(target=self.recvFunction)
# Set to daemon
t1.daemon=True
t1.start()
#Call the main UI
uI=self.clientUI()
## Main GUI building function
def clientUI(self):
'''ClientUI and Widget creation
'''
# Colours
foreground_colour = Color(30,57,68)
background_colour = Color(247,246,242)
window_background = Color(145,190,210)
# Borders
self.border2=BorderFactory.createLineBorder(foreground_colour,1, True)
# Fonts
self.font= Font("Ubuntu Light", Font.BOLD, 20)
self.label_font= Font("Ubuntu Light", Font.BOLD, 17)
self.label_2_font= Font( "Ubuntu Light",Font.BOLD, 12)
self.btn_font=Font("Ubuntu Light", Font.BOLD, 15)
# Set the layout parameters
self.client_layout=GroupLayout(self.getContentPane())
self.getContentPane().setLayout(self.client_layout)
self.getContentPane().setBackground(window_background)
self.client_layout.setAutoCreateGaps(True)
self.client_layout.setAutoCreateContainerGaps(True)
self.setPreferredSize(Dimension(400, 450))
# Create widgets and assemble the GUI
# Main display area
self.main_content=JTextPane()
self.main_content.setBackground(background_colour)
#self.main_content.setForeground(foreground_colour)
self.main_content.setEditable(False)
# Message entry area
self.message=JTextArea( 2,2, border=self.border2, font=self.label_font, keyPressed=self.returnKeyPress)
self.message.requestFocusInWindow()
self.message.setBackground(background_colour)
self.message.setForeground(foreground_colour)
self.message.setLineWrap(True)
self.message.setWrapStyleWord(True)
self.message.setBorder(BorderFactory.createEmptyBorder(3,3,3,3))
self.message.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), self.returnKeyPress)
# BUttons
quit_btn=JButton("Quit!", actionPerformed=ChatApp().closeEvent, border=self.border2, font=self.btn_font)
go_btn=JButton("Send", actionPerformed=self.grabText, border=self.border2, font=self.btn_font)
quit_btn.setBackground(background_colour)
go_btn.setBackground(background_colour)
quit_btn.setForeground(foreground_colour)
go_btn.setForeground(foreground_colour)
# Make scrollable
self.scroll_content=JScrollPane(self.main_content)
self.scroll_content.setPreferredSize(Dimension(150,275))
self.scroll_content.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)
self.scroll_content.setViewportView(self.main_content)
self.scroll_content.setBackground(Color.WHITE)
self.scroll_message=JScrollPane(self.message)
self.scroll_message.setPreferredSize(Dimension(150,20))
self.scroll_message.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS)
# Test user label, still not updating after first round of messages
self.user_label=JLabel(" Users online : %s "%(str(len(self.no_users))),JLabel.RIGHT, font=self.label_2_font)
# Assemble the components
# Horizontal layout
self.client_layout.setHorizontalGroup(self.client_layout.createParallelGroup()
.addComponent(self.scroll_content)
.addGroup(self.client_layout.createParallelGroup(GroupLayout.Alignment.CENTER)
.addComponent(self.scroll_message))
.addGroup(self.client_layout.createSequentialGroup()
.addComponent(quit_btn)
.addComponent(go_btn).addGap(20))
.addGroup(self.client_layout.createParallelGroup()
.addComponent(self.user_label))
)
# Vertical layout
self.client_layout.setVerticalGroup(self.client_layout.createSequentialGroup()
.addGroup(self.client_layout.createParallelGroup()
.addComponent(self.scroll_content))
#.........這裏部分代碼省略.........
示例12: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self):
super(WorkHelper, self).__init__()
self.clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
#self.initUI()
#def initUI(self):
#panel = JPanel()
#self.getContentPane().add(panel)
#############################################################
# Layout
layout = GroupLayout(self.getContentPane())
self.getContentPane().setLayout(layout)
layout.setAutoCreateGaps(True)
layout.setAutoCreateContainerGaps(True)
#############################################################
#############################################################
# Scroll Area Input + Output
Larea1 = JLabel("InputArea:")
Larea2 = JLabel("OutputArea:")
Sarea1 = JScrollPane()
Sarea2 = JScrollPane()
self.area1 = JTextArea()
self.area1.setToolTipText("Input Area")
self.area1.setEditable(True)
self.area1.setBorder(BorderFactory.createLineBorder(Color.gray))
Sarea1.setPreferredSize(Dimension(300,100))
Sarea1.getViewport().setView((self.area1))
self.area2 = JTextArea()
self.area2.setToolTipText("Output Area")
self.area2.setEditable(False)
self.area2.setBorder(BorderFactory.createLineBorder(Color.gray))
Sarea2.setPreferredSize(Dimension(300,100))
Sarea2.getViewport().setView((self.area2))
#############################################################
#############################################################
# Buttons
self.cCurly = JCheckBox("Curly");
self.cCurly.setToolTipText("When 'Checked' Curly Brackets will surround the Categories")
self.cCurly.setSelected(1)
self.cCtClipB = JCheckBox("Auto-Copy");
self.cCtClipB.setToolTipText("When 'Checked' after the Categories are created they will added to the clipboard")
self.cCtClipB.setSelected(1)
self.cSemiC = JCheckBox("SemiColumn");
self.cSemiC.setToolTipText("When 'Checked' after the Categories are created at the end will be a semicolomn")
self.cSemiC.setSelected(1)
bRemoveNBSP_L = JButton("Clean LText", actionPerformed=self.bRemoveNBSP_L)
bRemoveNBSP_L.setToolTipText("Removes Spaces, Tabs from the start of every text line from the input Area")
bRemoveNBSP_R = JButton("Clean RText", actionPerformed=self.bRemoveNBSP_R)
bRemoveNBSP_R.setToolTipText("Removes Spaces, Tabs from the end of every text line from the input Area")
bCopyToInput = JButton("Copy to Input", actionPerformed=self.bCopyToInput)
bCopyToInput.setToolTipText("Copy the text from the Output Area to the Input Area for further Operations")
bClear = JButton("Clear", actionPerformed=self.bClear)
bClear.setToolTipText("Clears the text form both Input and Output text Areas")
self.iStart = JTextField(maximumSize=Dimension(40,25))
self.iStart.setToolTipText("The Start Index for the Making of the Categories")
self.RThis = JTextField()
self.RThis = JTextField(maximumSize=Dimension(120,25))
self.RThis.setToolTipText("Text to be replaced or The Starting C_Index")
self.RThat = JTextField()
self.RThat = JTextField(maximumSize=Dimension(120,25))
self.RThat.setToolTipText("Text to be placed or The Finish C_Index")
bSandReplace = JButton("Replace Text", actionPerformed=self.bSandReplace)
bSandReplace.setToolTipText("Replace the text from This with Thext from That in the Text from the Input Area and displays it in the Output Area")
bcCat = JButton("CreatCateg", actionPerformed=self.bcCat)
bcCat.setToolTipText("Create a categorical form starting C_Index to finish C_Index; Use the above text boxes to define the indexes")
bC_S = JButton("Create _Series", actionPerformed=self.bC_S)
bC_S.setToolTipText("Create a series form starting C_Index to finish C_Index; Use the above text boxes to define the indexes; It will create a series for every row in the Input Area")
bM_Categories = JButton("Categories", actionPerformed=self.mCategories)
bM_Categories.setToolTipText("Make Categories using the lines from the Input Area")
#bM_Categories = JButton(maximumSize=Dimension(40,25))
# de incercat daca merge cu ; sa grupezi in [dsa] elementele
#############################################################
#.........這裏部分代碼省略.........
示例13: __init__
# 需要導入模塊: from javax.swing import JScrollPane [as 別名]
# 或者: from javax.swing.JScrollPane import setPreferredSize [as 別名]
def __init__(self):
super(WorkHelper, self).__init__()
self.clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
#############################################################
# Layout:
layout = GroupLayout(self.getContentPane())
self.getContentPane().setLayout(layout)
layout.setAutoCreateGaps(True)
layout.setAutoCreateContainerGaps(True)
#############################################################
#############################################################
# Frame Area:
Larea1 = JLabel("InputArea:")
Sarea1 = JScrollPane()
self.area1 = JTextArea()
self.area1.setToolTipText("Input Area")
self.area1.setEditable(True)
self.area1.setBorder(BorderFactory.createLineBorder(Color.gray))
Sarea1.setPreferredSize(Dimension(300,100))
Sarea1.getViewport().setView((self.area1))
bClear = JButton("Clear", actionPerformed=self.bClear)
bClear.setToolTipText("Clears the text form both Input and Output text Areas")
bCopyToInput = JButton("Copy to Input", actionPerformed=self.bCopyToInput)
bCopyToInput.setToolTipText("Copy the text from the Output Area to the Input Area for further Operations")
self.cCtClipB = JCheckBox("Auto-Copy");
self.cCtClipB.setToolTipText("When 'Checked' after the Categories are created they will added to the clipboard")
self.cCtClipB.setSelected(1)
Larea2 = JLabel("OutputArea:")
Sarea2 = JScrollPane()
self.area2 = JTextArea()
self.area2.setToolTipText("Output Area")
self.area2.setEditable(False)
self.area2.setBorder(BorderFactory.createLineBorder(Color.gray))
Sarea2.setPreferredSize(Dimension(300,100))
Sarea2.getViewport().setView((self.area2))
#############################################################
# Tabbed Area:
tabPane = JTabbedPane(JTabbedPane.TOP)
self.getContentPane().add(tabPane)
#####################################################
# Text Edit pane
panel_TEdit = JPanel()
layout2 = GroupLayout(panel_TEdit)
layout2.setAutoCreateGaps(True)
layout2.setAutoCreateContainerGaps(True)
panel_TEdit.setLayout(layout2)
bRemoveNBSP_L = JButton("Clean LText", actionPerformed=self.bRemoveNBSP_L)
bRemoveNBSP_L.setToolTipText("Removes Spaces, Tabs from the start of every text line from the input Area")
bRemoveNBSP_R = JButton("Clean RText", actionPerformed=self.bRemoveNBSP_R)
bRemoveNBSP_R.setToolTipText("Removes Spaces, Tabs from the end of every text line from the input Area")
self.ReplaceThis = JTextField()
self.ReplaceThis = JTextField(maximumSize=Dimension(120,25))
self.ReplaceThis.setToolTipText("Text to be replaced")
self.ReplaceThat = JTextField()
self.ReplaceThat = JTextField(maximumSize=Dimension(120,25))
self.ReplaceThat.setToolTipText("Text to be placed")
bSandReplace = JButton("Replace Text", actionPerformed=self.bSandReplace)
bSandReplace.setToolTipText("Replace the text from This with Text from That in the Text from the Input Area and displays it in the Output Area")
bRemNumbers = JButton("Rem Numbers", actionPerformed=self.RemNumbers)
bRemNumbers.setToolTipText("Removes numbers from the start of every line")
#####################################################
# Dimension pane
panel_Dimensions = JPanel()
layout3 = GroupLayout(panel_Dimensions)
layout3.setAutoCreateGaps(True)
layout3.setAutoCreateContainerGaps(True)
panel_Dimensions.setLayout(layout3)
self.cCurly = JCheckBox("Curly");
self.cCurly.setToolTipText("When 'Checked' Curly Brackets will surround the Categories")
self.cCurly.setSelected(1)
self.cSemiC = JCheckBox("SemiColumn");
self.cSemiC.setToolTipText("When 'Checked' after the Categories are created at the end will be a semicolomn")
self.cSemiC.setSelected(1)
self.iStart = JTextField(maximumSize=Dimension(40,25))
self.iStart.setToolTipText("The Start Index for the Making of the Categories")
self.RThis = JTextField()
self.RThis = JTextField(maximumSize=Dimension(120,25))
self.RThis.setToolTipText("The Starting Index used in creating the Categorical")
self.RThat = JTextField()
#.........這裏部分代碼省略.........