org.jdesktop.swingx.JXPanel Java Examples
The following examples show how to use
org.jdesktop.swingx.JXPanel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CopyMongoCollectionService.java From gameserver with Apache License 2.0 | 6 votes |
public CopyMongoCollectionService( String sourceDatabase, String sourceNamespace, String sourceCollection, String targetDatabase, String targetNamespace, String targetCollection) { this.sourceDatabase = sourceDatabase; this.sourceNamespace = sourceNamespace; this.sourceCollection = sourceCollection; this.targetDatabase = targetDatabase; this.targetNamespace = targetNamespace; this.targetCollection = targetCollection; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #2
Source File: WeaponManualDataImportService.java From gameserver with Apache License 2.0 | 6 votes |
public WeaponManualDataImportService( File file, WeaponTableModel model, ArrayList<Double> dprList) { this.importExcelFile = file; this.weaponModel = model; this.levelDprList = dprList; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #3
Source File: StrengthTestService.java From gameserver with Apache License 2.0 | 6 votes |
public StrengthTestService( StrengthTestConfig config, MyTablePanel tablePanel) { this.model = model; this.config = config; this.count = config.getMaxTry(); this.tablePanel = tablePanel; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); model = new StrengthTestResultModel(); tablePanel.setTableModel(model); }
Example #4
Source File: CraftStonePrintService.java From gameserver with Apache License 2.0 | 6 votes |
public CraftStonePrintService(CraftStoneResultModel model, CraftStonePrintConfig config, int count, MyTablePanel tablePanel) { this.model = model; this.config = config; this.count = count; this.tablePanel = tablePanel; this.model.setTotalCount(count); panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #5
Source File: EquipmentImportService.java From gameserver with Apache License 2.0 | 6 votes |
public EquipmentImportService(MyTableModel model, ShopDataPriceConfig config) { this.model = model; this.config = config; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #6
Source File: EquipmentExportService.java From gameserver with Apache License 2.0 | 6 votes |
public EquipmentExportService(MyTableModel model, ShopDataPriceConfig config) { this.model = model; this.config = config; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #7
Source File: ShopDataPriceFromDBSaveService.java From gameserver with Apache License 2.0 | 6 votes |
public ShopDataPriceFromDBSaveService(ShopDataPriceResultModel model) { this.model = model; this.count = model.getRowCount(); panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); simpleTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SIMPLE, 30); normalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_NORMAL, 100); solidTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SOLID, 200); eternalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_ETERNAL, Integer.MAX_VALUE); }
Example #8
Source File: ManagePropDataSlotDialog.java From gameserver with Apache License 2.0 | 6 votes |
public void init() { this.setSize(600, 400); Point c = WindowUtils.getPointForCentering(this); this.setLocation(c); this.setLayout(new MigLayout("wrap 3")); for ( PropDataSlotPanel panel : panels ) { this.add(panel, ""); } this.okButton.setActionCommand(ActionName.OK.name()); this.okButton.addActionListener(this); this.cancelButton.setActionCommand(ActionName.CANCEL.name()); this.cancelButton.addActionListener(this); JXPanel btnPanel = new JXPanel(); btnPanel.add(okButton); btnPanel.add(cancelButton); this.add(btnPanel, "dock south, width 100%"); this.pack(); this.setModal(true); }
Example #9
Source File: WeaponDataSaveService.java From gameserver with Apache License 2.0 | 6 votes |
public WeaponDataSaveService( Collection<WeaponPojo> weapons, String targetDatabase, String targetNamespace, String targetCollection) { this.weapons = weapons; this.targetDatabase = targetDatabase; this.targetNamespace = targetNamespace; this.targetCollection = targetCollection; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #10
Source File: BackupMongoConfigService.java From gameserver with Apache License 2.0 | 6 votes |
public BackupMongoConfigService(File backupDir, String[] backupCollections) { this.backupDir = backupDir; this.backupDir.getParentFile().mkdirs(); panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.backupCollections = backupCollections; }
Example #11
Source File: PushDialog.java From gameserver with Apache License 2.0 | 6 votes |
public void init() { this.setTitle("消息管理"); this.setSize(500, 300); Point p = WindowUtils.getPointForCentering(this); this.setLocation(p); this.setModal(true); this.okButton.setActionCommand(ActionName.OK.name()); this.okButton.addActionListener(this); this.cancelButton.setActionCommand(ActionName.CANCEL.name()); this.cancelButton.addActionListener(this); this.infoField.setText(""); JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]")); loginPanel.add(this.statusLabel, "span"); loginPanel.add(this.infoField, "span, growx"); loginPanel.setBorder(BorderFactory.createTitledBorder("PUSH")); JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]")); this.setLayout(new MigLayout("wrap 1")); panel.add(loginPanel, "growx"); panel.add(this.okButton, "gaptop 5px, span, split 3, align center"); panel.add(this.cancelButton); this.add(panel, "width 100%, height 100%"); }
Example #12
Source File: RestoreMongoConfigService.java From gameserver with Apache License 2.0 | 6 votes |
public RestoreMongoConfigService(File backupDir, boolean clean, String[] backupCollections) { this.backupDir = backupDir; this.backupDir.getParentFile().mkdirs(); this.cleanOldData = clean; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.backupCollections = backupCollections; }
Example #13
Source File: RedisRefreshService.java From gameserver with Apache License 2.0 | 6 votes |
public RedisRefreshService(RedisTreeTableModel treeTableModel, String host, int port) { this.treeTableModel = treeTableModel; this.host = host; this.port = port; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #14
Source File: RedisCleanService.java From gameserver with Apache License 2.0 | 6 votes |
public RedisCleanService(Jedis jedis) { this.treeTableModel = treeTableModel; this.jedis = jedis; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #15
Source File: ShopDataPricePrintService.java From gameserver with Apache License 2.0 | 6 votes |
public ShopDataPricePrintService(MyTableModel model, ShopDataPriceConfig config) { this.model = model; this.config = config; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #16
Source File: ShopDataPriceSaveService.java From gameserver with Apache License 2.0 | 6 votes |
public ShopDataPriceSaveService(ShopDataPriceResultModel model) { this.model = model; this.count = model.getRowCount(); panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); simpleTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SIMPLE, 30); normalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_NORMAL, 100); solidTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_SOLID, 200); eternalTimes = GameDataManager.getInstance().getGameDataAsInt(GameDataKey.WEAPON_INDATE_ETERNAL, Integer.MAX_VALUE); }
Example #17
Source File: ChargeDialog.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { this.setTitle("充值管理"); this.setSize(900, 280); Point p = WindowUtils.getPointForCentering(this); this.setLocation(p); this.setModal(true); this.okButton.setActionCommand(ActionName.OK.name()); this.okButton.addActionListener(this); this.cancelButton.setActionCommand(ActionName.CANCEL.name()); this.cancelButton.addActionListener(this); this.infoField.setText(info); this.infoField.setEditable(false); JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]")); loginPanel.add(this.statusLabel, "sg lbl"); loginPanel.add(this.valueField, "sg fd, width 10%"); loginPanel.setBorder(BorderFactory.createTitledBorder("充值管理")); JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]")); this.setLayout(new MigLayout("wrap 1")); panel.add(loginPanel, "growx"); panel.add(infoField, "grow"); panel.add(this.okButton, "gaptop 5px, span, split 3, align center"); panel.add(this.cancelButton); this.add(panel, "width 100%, height 100%"); }
Example #18
Source File: FlatDatePickerUI.java From FlatLaf with Apache License 2.0 | 5 votes |
@Override public void installUI( JComponent c ) { // must get UI defaults here because installDefaults() is invoked after // installComponents(), which uses these values to create popup button padding = UIManager.getInsets( "ComboBox.padding" ); arrowType = UIManager.getString( "Component.arrowType" ); borderColor = UIManager.getColor( "Component.borderColor" ); disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" ); disabledBackground = UIManager.getColor( "ComboBox.disabledBackground" ); buttonBackground = UIManager.getColor( "ComboBox.buttonBackground" ); buttonArrowColor = UIManager.getColor( "ComboBox.buttonArrowColor" ); buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" ); buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" ); super.installUI( c ); LookAndFeel.installProperty( datePicker, "opaque", false ); // hack JXDatePicker.TodayPanel colors // (there is no need to uninstall these changes because only UIResources are used, // which are automatically replaced when switching LaF) JPanel linkPanel = datePicker.getLinkPanel(); if( linkPanel instanceof JXPanel && linkPanel.getClass().getName().equals( "org.jdesktop.swingx.JXDatePicker$TodayPanel" ) ) { ((JXPanel)linkPanel).setBackgroundPainter( null ); linkPanel.setBackground( UIManager.getColor( "JXMonthView.background" ) ); if( linkPanel.getComponentCount() >= 1 && linkPanel.getComponent( 0 ) instanceof JXHyperlink ) { JXHyperlink todayLink = (JXHyperlink) linkPanel.getComponent( 0 ); todayLink.setUnclickedColor( UIManager.getColor( "Hyperlink.linkColor" ) ); todayLink.setClickedColor( UIManager.getColor( "Hyperlink.visitedColor" ) ); } } }
Example #19
Source File: TaskWeaponDataBalancePanel.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { ToolTipManager.sharedInstance().setDismissDelay(86400000); this.combatCountField.setValue(10); this.levelField.setValue(5); this.strengthField.setValue(5); this.startBtn.addActionListener(this); this.startBtn.setActionCommand(ActionName.OK.name()); this.myTable.setTableModel(myTableModel); this.myTable.setEnableAddRow(false); this.myTable.setEnableDelRow(true); this.myTable.setEnableSaveButton(false); this.myTable.setEditable(true); this.myTable.setEnableRrefresh(true); this.myTable.setRefreshAction(new WeaponBalanceTableRefreshAction(myTable)); this.myTable.getTable().setDefaultRenderer(Object.class, new BlanceResultRenderer()); this.myTable.getTable().setEditorFactory(displayDialog); JXPanel userPanel = new JXPanel(new MigLayout("wrap 2")); userPanel.add(user1Panel, "width 50%, height 100%, grow"); userPanel.add(user2Panel, "width 50%, height 100%, grow"); this.setLayout(new MigLayout("wrap 2")); this.add(userPanel, "span, width 100%, height 30%"); this.add(combatCountLabel, "span, split 7"); this.add(combatCountField, "width 10%"); this.add(levelLabel, "width 10%"); this.add(levelField, "width 10%"); this.add(strengthLabel, "width 10%"); this.add(strengthField, "width 10%"); this.add(startBtn, "width 10%"); this.add(myTable, "span, width 100%, height 70%, grow"); }
Example #20
Source File: DownloadIconsService.java From gameserver with Apache License 2.0 | 5 votes |
@Override protected void process(List<Integer> chunks) { if ( stage == Stage.GET_NUM_OF_ICONS ) { panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); dialog.setVisible(true); label.setText("正在获取图标列表..."); label.setFont(MainFrame.BIG_FONT); progressBar.setIndeterminate(true); } else if ( stage == Stage.GOT_NUM_OF_ICONS ) { label.setFont(MainFrame.BIG_FONT); label.setText("总图标数量: " + icons.size()); label.repaint(); progressBar.setIndeterminate(false); progressBar.setMinimum(0); progressBar.setMaximum(icons.size()); progressBar.setStringPainted(true); } else if ( stage == Stage.DOWNLOAD_ICONS ) { if ( chunks != null && chunks.size()>0 ) { int percent = chunks.get(chunks.size()-1); progressBar.setValue(percent); } } else if ( stage == Stage.INITIAL_EQUIPS ) { label.setText("正在初始化装备数据..."); progressBar.setIndeterminate(true); } }
Example #21
Source File: TemplateService.java From gameserver with Apache License 2.0 | 5 votes |
public TemplateService() { panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
Example #22
Source File: TaskLoginPanel.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { //创建工作区域 this.setLayout(new MigLayout("")); LoginManager.getInstance().reload(); this.majorVersionField.setValue(LoginManager.getInstance().getClientMajorVersion()); this.minorVersionField.setValue(LoginManager.getInstance().getClientMinorVersion()); this.configVersionField.setValue(LoginManager.getInstance().getClientConfigVersion()); this.clientVersionOKButton.setActionCommand(ActionName.OK.name()); this.clientVersionOKButton.addActionListener(this); this.bulletinField.setColumns(100); this.bulletinField.setRows(20); this.sendButton.setActionCommand(ACTION_SEND); this.sendButton.addActionListener(this); this.sendButton.setText("发送"); this.expireField.setValue(0); JXPanel versionPanel = new JXPanel(new MigLayout("wrap 4")); versionPanel.setBorder(BorderFactory.createTitledBorder("登陆管理")); versionPanel.add(clientVersionLabel, "width 25%"); versionPanel.add(majorVersionField, "width 10%"); versionPanel.add(minorVersionField, "width 10%"); versionPanel.add(configVersionLabel, "newline, width 25%"); versionPanel.add(configVersionField, "width 20%, wrap"); versionPanel.add(clientVersionOKButton, "width 10%, align center"); JXPanel bulletinPanel = new JXPanel(new MigLayout("wrap 1")); bulletinPanel.setBorder(BorderFactory.createTitledBorder("消息管理")); bulletinPanel.add(bulletinField, "grow"); bulletinPanel.add(typeField, "split 4"); bulletinPanel.add(expireField, "width 5%"); bulletinPanel.add(serverBox, ""); bulletinPanel.add(sendButton, "align center"); this.add(versionPanel, "width 100%, wrap"); this.add(bulletinPanel, "width 100%"); }
Example #23
Source File: TaskReloadConfigPanel.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { JXPanel settingPanel = new JXPanel(); TitledBorder border = BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "服务器设定"); border.setTitleFont(MainFrame.BIG_FONT); settingPanel.setBorder(border); this.okButton.setActionCommand(ActionName.OK.name()); this.okButton.addActionListener(this); settingPanel.setLayout(new MigLayout("wrap 4, gap 10px, alignx center", "")); settingPanel.add(this.lblGameServer, "sg lb"); settingPanel.add(this.gameServerField, "sg fd, growx, pushx"); settingPanel.add(this.lblGamePort, "sg lb"); settingPanel.add(this.gameServerPort, "sg fd, growx, pushx"); JXPanel configPanel = new JXPanel(); TitledBorder backupBorder = BorderFactory.createTitledBorder("配置文件"); backupBorder.setTitleFont(MainFrame.BIG_FONT); configPanel.setBorder(backupBorder); configPanel.setLayout(new MigLayout("wrap 4, align center")); JXPanel collPanel = new JXPanel(); collPanel.setLayout(new MigLayout("wrap 4, align center")); collPanel.setBorder(BorderFactory.createEtchedBorder()); for ( int i=0; i<CONFIG_NAMES.length; i++ ) { String collection = CONFIG_NAMES[i]; backupCollections[i] = new JCheckBox(collection); collPanel.add(backupCollections[i], "sg checkbox"); } configPanel.add(collPanel, "align center, width 100%"); configPanel.add(this.okButton, "newline, span, split 2, alignx center, aligny bottom"); this.setLayout(new MigLayout("wrap 1")); this.add(settingPanel, "width 100%"); this.add(configPanel, "width 100%"); }
Example #24
Source File: ManageAccountStatusDialog.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { this.setTitle("管理账户状态"); this.setSize(320, 430); Point p = WindowUtils.getPointForCentering(this); this.setLocation(p); this.setModal(true); this.statusField.setActionCommand(CMD_STATUS_SELECT); this.statusField.addActionListener(this); this.statusField.setSelectedIndex(0); this.okButton.setActionCommand(ActionName.OK.name()); this.okButton.addActionListener(this); this.cancelButton.setActionCommand(ActionName.CANCEL.name()); this.cancelButton.addActionListener(this); this.previewButton.setActionCommand(CMD_PREVIEW); this.previewButton.addActionListener(this); JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]")); loginPanel.add(this.statusLabel, "sg lbl"); loginPanel.add(this.statusField, "sg fd, grow"); loginPanel.add(this.descField, "span, grow"); loginPanel.add(this.previewButton, "gaptop 5px, span, split 3, align center"); loginPanel.setBorder(BorderFactory.createTitledBorder("登陆管理")); JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]")); this.setLayout(new MigLayout("wrap 1")); panel.add(loginPanel); panel.add(this.okButton, "gaptop 5px, span, split 3, align center"); panel.add(this.cancelButton); this.add(panel, "width 100%, height 100%"); }
Example #25
Source File: ShopDataImportItemPriceService.java From gameserver with Apache License 2.0 | 5 votes |
public ShopDataImportItemPriceService() { panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); this.dialog = new JDialog(); this.dialog.add(panel); this.dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); this.dialog.setLocation(p); this.dialog.setModal(true); this.dialog.setResizable(false); this.dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.progressBar.setIndeterminate(true); }
Example #26
Source File: WeaponBalanceTestService.java From gameserver with Apache License 2.0 | 5 votes |
@Override protected void process(List<Integer> chunks) { if ( stage == Stage.INIT ) { panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); label.setFont(MainFrame.BIG_FONT); progressBar.setMaximum(count); progressBar.setStringPainted(true); dialog.setVisible(true); } else if ( stage == Stage.DO_BALANCE_TEST ) { label.setText("正在模拟战斗..."); if ( chunks != null && chunks.size()>0 ) { int percent = chunks.get(chunks.size()-1); progressBar.setValue(percent); } } }
Example #27
Source File: WeaponDataGeneratorService.java From gameserver with Apache License 2.0 | 5 votes |
public WeaponDataGeneratorService(List<String> namePrefixes, List<Integer> dprList, double[] params) { this.origWeaponList = new ArrayList<WeaponPojo>(); List<DBObject> list = MongoUtil.queryAllFromMongo(null, database, namespace, "equipments", null); for ( DBObject obj : list ) { WeaponPojo weapon = (WeaponPojo)MongoUtil.constructObject(obj); this.origWeaponList.add(weapon); } Collections.sort(this.origWeaponList); if ( namePrefixes != null ) { this.namePrefixes.addAll(namePrefixes); } if ( dprList != null ) { this.dprList.addAll(dprList); } attackUnit = params[0]; defendUnit = params[1]; luckUnit = params[2]; agilityUnit = params[3]; panel = new JXPanel(); panel.setLayout(new MigLayout("wrap 1")); panel.add(label, "growx, wrap 20"); panel.add(progressBar, "grow, push"); dialog = new JDialog(); dialog.add(panel); dialog.setSize(300, 120); Point p = WindowUtils.getPointForCentering(dialog); dialog.setLocation(p); dialog.setModal(true); dialog.setResizable(false); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.progressBar.setIndeterminate(true); }
Example #28
Source File: MultiUserMailDialog.java From gameserver with Apache License 2.0 | 5 votes |
public void init() { this.setSize(650, 600); Point point = WindowUtils.getPointForCentering(this.getOwner()); this.setLocation(point); this.setResizable(true); this.subjectField.setColumns(100); this.contentField.setColumns(100); this.contentField.setRows(20); this.checkButton.setActionCommand(COMMAND_CHECK); this.checkButton.addActionListener(this); this.okButton.setActionCommand(COMMAND_OK); this.okButton.addActionListener(this); this.cancelButton.setActionCommand(COMMAND_CANCEL); this.cancelButton.addActionListener(this); this.panel.getInputMap().put(KeyStroke.getKeyStroke("ESCAPE"), "escape"); this.panel.getActionMap().put("escape", new EscapeAction()); //layout panel.setLayout(new MigLayout("wrap 2, width 100%, gap 10px", "[25%][25%][25%][25%]")); panel.setBorder(BorderFactory.createEtchedBorder()); panel.add(rolenameLabel, ""); panel.add(rolenameField, "span, growx"); panel.add(subjectLabel, ""); panel.add(subjectField, "span, growx"); panel.add(contentLabel, ""); panel.add(contentField, "span, growx"); panel.add(checkButton); panel.add(okButton, "newline, gaptop 40px, span, split 2, align center"); panel.add(cancelButton); JXPanel contentPanel = new JXPanel(); contentPanel.setLayout(new MigLayout("wrap 2, width 100%, height 100%")); contentPanel.add(panel, "width 60%, height 100%, grow"); getContentPane().add(contentPanel); }
Example #29
Source File: QuickStartPanel.java From zap-extensions with Apache License 2.0 | 5 votes |
private JXPanel getNewsPanel() { if (newsPanel == null) { newsPanel = new QuickStartBackgroundPanel(); if (newsItem != null) { this.showNews(newsItem); } } return newsPanel; }
Example #30
Source File: Stacker.java From Darcula with Apache License 2.0 | 5 votes |
/** * Fades in the specified message component in the top layer of this * layered pane. * @param message the component to be displayed in the message layer * @param finalAlpha the alpha value of the component when fade in is complete */ public void showMessageLayer(JComponent message, final float finalAlpha) { messageLayer = new JPanel(); messageLayer.setOpaque(false); GridBagLayout gridbag = new GridBagLayout(); messageLayer.setLayout(gridbag); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.CENTER; messageAlpha = new JXPanel(); messageAlpha.setOpaque(false); messageAlpha.setAlpha(0.0f); gridbag.addLayoutComponent(messageAlpha, c); messageLayer.add(messageAlpha); messageAlpha.add(message); add(messageLayer, JLayeredPane.POPUP_LAYER); revalidate(); SwingUtilities.invokeLater(new Runnable() { public void run() { Animator animator = new Animator(2000, new PropertySetter(messageAlpha, "alpha", 0.0f, finalAlpha)); animator.setStartDelay(200); animator.setAcceleration(.2f); animator.setDeceleration(.5f); animator.start(); } }); }