📄 editorplugin.java
字号:
public void actionPerformed(java.awt.event.ActionEvent evt) { AbortExitActionPerformed(evt); } }); jPanel6.add(AbortExit); AbortExit.setBounds(280, 100, 70, 20); DeleteExit.setForeground(new java.awt.Color(153, 0, 51)); DeleteExit.setText("Delete"); DeleteExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { DeleteExitActionPerformed(evt); } }); jPanel6.add(DeleteExit); DeleteExit.setBounds(280, 220, 80, 20); SuspendExit.setForeground(new java.awt.Color(153, 51, 255)); SuspendExit.setText("Suspend"); SuspendExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SuspendExitActionPerformed(evt); } }); jPanel6.add(SuspendExit); SuspendExit.setBounds(280, 70, 84, 20); CompleteExit.setForeground(new java.awt.Color(102, 102, 255)); CompleteExit.setText("Save"); CompleteExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CompleteExitActionPerformed(evt); } }); jPanel6.add(CompleteExit); CompleteExit.setBounds(280, 180, 80, 20); ResumeExit.setForeground(new java.awt.Color(102, 102, 255)); ResumeExit.setText("Resume"); ResumeExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ResumeExitActionPerformed(evt); } }); jPanel6.add(ResumeExit); ResumeExit.setBounds(280, 150, 81, 20); jSplitPane2.setRightComponent(jPanel6); jPanel36.add(jSplitPane2, java.awt.BorderLayout.CENTER); jPanel1.setMinimumSize(new java.awt.Dimension(298, 50)); jPanel1.setPreferredSize(new java.awt.Dimension(298, 50)); HelpOnMapExit.setForeground(new java.awt.Color(255, 51, 51)); HelpOnMapExit.setText("<html><b>Write a name in Name field then <p>click the Add button to start adding a Map Exit.....</b></html>"); jPanel1.add(HelpOnMapExit); jPanel36.add(jPanel1, java.awt.BorderLayout.NORTH); MapExitsPan.add(jPanel36, java.awt.BorderLayout.CENTER); MainTabb.addTab("Map Exits", MapExitsPan); SchedulePan.setLayout(new java.awt.BorderLayout()); jButton3.setText("Add"); jPanel38.add(jButton3); jButton4.setText("Delete"); jPanel38.add(jButton4); SchedulePan.add(jPanel38, java.awt.BorderLayout.SOUTH); jLabel21.setText("............."); jPanel9.add(jLabel21); SchedulePan.add(jPanel9, java.awt.BorderLayout.NORTH); jPanel23.setLayout(new java.awt.BorderLayout()); jSplitPane3.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jPanel32.setMinimumSize(new java.awt.Dimension(100, 100)); jPanel32.setPreferredSize(new java.awt.Dimension(100, 100)); jSplitPane3.setBottomComponent(jPanel32); jList2.setMaximumSize(new java.awt.Dimension(32767, 32767)); jList2.setMinimumSize(new java.awt.Dimension(100, 100)); jList2.setPreferredSize(new java.awt.Dimension(100, 100)); jSplitPane3.setTopComponent(jList2); jPanel23.add(jSplitPane3, java.awt.BorderLayout.CENTER); SchedulePan.add(jPanel23, java.awt.BorderLayout.CENTER); MainTabb.addTab("Schedule", SchedulePan); ImporExportPan.setFocusCycleRoot(true); jPanel29.setBorder(new javax.swing.border.TitledBorder("Background data")); jPanel24.setLayout(new java.awt.BorderLayout()); jPanel24.setBorder(new javax.swing.border.EtchedBorder()); jLabel27.setForeground(new java.awt.Color(255, 0, 255)); jLabel27.setText("<html>\n<body>\n<p>\n<p> Export/Import ONLY data\n<p>\n<p> of this map<p>\n<p>\n<p>\n</body>\n</html>"); jPanel24.add(jLabel27, java.awt.BorderLayout.CENTER); ExportBackground.setText("Export"); ExportBackground.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExportBackgroundActionPerformed(evt); } }); jPanel25.add(ExportBackground); ImportBackground.setText("Import"); ImportBackground.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ImportBackgroundActionPerformed(evt); } }); jPanel25.add(ImportBackground); jPanel24.add(jPanel25, java.awt.BorderLayout.SOUTH); jPanel29.add(jPanel24); jPanel26.setLayout(new java.awt.BorderLayout()); jPanel26.setBorder(new javax.swing.border.EtchedBorder()); jLabel28.setForeground(new java.awt.Color(255, 0, 0)); jLabel28.setText("<html>\n<body>\n<p>\n<p> Export ALL the MAPS \n<p>\n<p> to backup directory <p>\n<p>\n<p>\n</body>\n</html>"); jPanel26.add(jLabel28, java.awt.BorderLayout.CENTER); ExportAll.setText("Export All"); ExportAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExportAllActionPerformed(evt); } }); jPanel27.add(ExportAll); ImportAll.setText("Import All"); ImportAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ImportAllActionPerformed(evt); } }); jPanel27.add(ImportAll); jPanel26.add(jPanel27, java.awt.BorderLayout.SOUTH); jPanel29.add(jPanel26); ImporExportPan.add(jPanel29); MainTabb.addTab("Import/Export", ImporExportPan); add(MainTabb, java.awt.BorderLayout.CENTER); }//GEN-END:initComponents private void ImportAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ImportAllActionPerformed // Add your handling code here: gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); RefreshData(); }//GEN-LAST:event_ImportAllActionPerformed private void ExportAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExportAllActionPerformed new File( EditTile.getResourceManager().getEditorBackupDataDir() ).mkdirs(); StoreTileMapBackground onlyBackground; TileMap[] mapTiles; mapTiles = EditTile.getDataManager().getWorldManager( ).getWorldMapFromID(0).getTileMaps(); for(int i=0; i < mapTiles.length; i++){ onlyBackground = mapTiles[i].getStoreBackground(); EditTile.getResourceManager().BackupObject( (Object)onlyBackground , EditTile.getResourceManager().getEditorBackupDataDir()+File.separator +mapTiles[i].getShortName()+GRAPHIC_DATA_EXPORTED_EXT ); } }//GEN-LAST:event_ExportAllActionPerformed private void ImportBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ImportBackgroundActionPerformed try { StoreTileMapBackground onlyBackground; onlyBackground = (StoreTileMapBackground) EditTile.getResourceManager( ).RestoreObject(EditTile.workingOnThisTileMap.getFileName( )+GRAPHIC_DATA_EXPORTED_EXT ); EditTile.workingOnThisTileMap.setStoreBackground( onlyBackground ); } catch (Exception e){ JOptionPane.showMessageDialog( EditTile.getDataManager().getScreen(), "Missing import file!" ,"Warning" , JOptionPane.WARNING_MESSAGE ); return; } gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); RefreshData(); }//GEN-LAST:event_ImportBackgroundActionPerformed private void ExportBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExportBackgroundActionPerformed StoreTileMapBackground onlyBackground; onlyBackground = EditTile.workingOnThisTileMap.getStoreBackground(); EditTile.getResourceManager().BackupObject( (Object)onlyBackground, EditTile.workingOnThisTileMap.getFileName()+GRAPHIC_DATA_EXPORTED_EXT ); }//GEN-LAST:event_ExportBackgroundActionPerformed private void ResumeExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ResumeExitActionPerformed itSelf.HelpOnMapExit.setText("<html><b>Resume load selected exit in memory to choose<p>" +"a new destination for it. Click Save to finish.</b></html>"); addExitStatus = 10; }//GEN-LAST:event_ResumeExitActionPerformed private void CompleteExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CompleteExitActionPerformed if(addExitStatus != 10) return; MapExit mapExit1 = EditTile.workingOnThisTileMap.getManager().getMapExits()[ExitToLoad]; mapExit1.setTargetWotlasLocation( EditTile.getDataManager().getWorldManager( ).getWorldMapFromID(0).getTileMapFromID(indexMapsForExitPan).getLocation() ); mapExit1.setTargetPosition( EditTile.getDataManager().getWorldManager( ).getWorldMapFromID(0).getTileMapFromID(indexMapsForExitPan).getMapExits( )[indexMapsExitsForExitPan].getScreenPointFromExitLocation() ); mapExit1.setName(ExitName.getText()); addExitStatus = 0; ExitName.setText(""); SetListExitMod(); addListMapsForExitPan(); itSelf.HelpOnMapExit.setText(MAP_EXIT_START_MSG); gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); }//GEN-LAST:event_CompleteExitActionPerformed private void SuspendExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SuspendExitActionPerformed if( addExitStatus != 4 ) return; if( ExitName.getText().length() == 0){ JOptionPane.showMessageDialog( EditTile.getDataManager().getScreen(), "You miss to write a name for this exit!" ,"Warning" , JOptionPane.WARNING_MESSAGE ); return; } int x=0,y=0,xx=0,yy=0; x = tmp1.x; y = tmp1.y; if( x > tmp2.x ){ x = tmp2.x; xx = tmp1.x+1; } else yy = tmp2.y+1; if( y > tmp2.y ){ y = tmp2.y; yy = tmp1.y+1; } else yy = tmp2.y+1; MapExit mapExit1 = null; mapExit1 = EditTile.workingOnThisTileMap.getManager().addMapExit( new ScreenRectangle(x*32,y*32,xx*32,yy*32), ExitName.getText() ); mapExit1.setType( MapExit.TILEMAP_EXIT ); mapExit1.setMapExitSide( MapExit.NONE ); addExitStatus = 0; ExitName.setText(""); SetListExitMod(); addListMapsForExitPan(); itSelf.HelpOnMapExit.setText(MAP_EXIT_START_MSG); gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); }//GEN-LAST:event_SuspendExitActionPerformed private void DeleteExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteExitActionPerformed // EditTile.workingOnThisTileMap.get ?? remove it from the array and remake the array // to fill the hole. SetListExitMod(); addListMapsForExitPan(); gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); RefreshData(); }//GEN-LAST:event_DeleteExitActionPerformed private void AbortExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AbortExitActionPerformed ExitName.setText(""); itSelf.HelpOnMapExit.setText(MAP_EXIT_START_MSG); addExitStatus = 0; }//GEN-LAST:event_AbortExitActionPerformed private void SaveExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveExitActionPerformed if( addExitStatus != 4 ) return; if( ExitName.getText().length() == 0) JOptionPane.showMessageDialog( EditTile.getDataManager().getScreen() , "You miss to write a name for this exit!" ,"Warning" , JOptionPane.WARNING_MESSAGE ); int x=0,y=0,xx=0,yy=0; x = tmp1.x; y = tmp1.y; if( x > tmp2.x ){ x = tmp2.x; xx = tmp1.x-tmp2.x; } else xx = tmp2.x-tmp1.x; if( y > tmp2.y ){ y = tmp2.y; yy = tmp1.y-tmp2.y; } else yy = tmp2.y-tmp1.y; MapExit mapExit1 = null;// System.out.println( (x*32)+","+(y*32)+","+(xx*32)+","+(yy*32) ); mapExit1 = EditTile.workingOnThisTileMap.getManager().addMapExit( new ScreenRectangle(x*32,y*32,(xx+1)*32,(yy+1)*32), ExitName.getText() ); mapExit1.setType( MapExit.TILEMAP_EXIT ); mapExit1.setMapExitSide( MapExit.NONE ); mapExit1.setTargetWotlasLocation( EditTile.getDataManager().getWorldManager( ).getWorldMapFromID(0).getTileMapFromID(indexMapsForExitPan).getLocation() ); mapExit1.setTargetPosition( EditTile.getDataManager().getWorldManager(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -