Skip to content

Commit 0cbf509

Browse files
committed
+ 优化了结构
+ macos程序坞图标 + 表格列的值可以复制
1 parent a3d4675 commit 0cbf509

File tree

16 files changed

+25
-6
lines changed

16 files changed

+25
-6
lines changed

src/org/cruldra/pdmviewer/PDMViewerApplication.java renamed to src/main/java/org/cruldra/pdmviewer/PDMViewerApplication.java

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.awt.datatransfer.Clipboard;
1111
import java.awt.datatransfer.StringSelection;
1212
import java.awt.event.*;
13+
import javax.imageio.ImageIO;
1314
import javax.swing.*;
1415
import javax.swing.GroupLayout;
1516
import javax.swing.LayoutStyle;
@@ -26,8 +27,10 @@
2627
import org.dom4j.io.OutputFormat;
2728
import org.dom4j.io.XMLWriter;
2829

30+
import java.awt.image.BufferedImage;
2931
import java.io.File;
3032
import java.io.IOException;
33+
import java.io.InputStream;
3134
import java.io.StringWriter;
3235
import java.util.ArrayList;
3336
import javax.swing.JFileChooser;
@@ -226,7 +229,7 @@ private void generateUpdateByPrimaryKeySelectiveBlockMenu(ActionEvent e) {
226229
}
227230
}
228231

229-
public PDMViewerApplication() {
232+
public PDMViewerApplication() throws IOException, UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException {
230233
initComponents();
231234
}
232235

@@ -238,7 +241,7 @@ public PDMViewerApplication() {
238241
@SuppressWarnings("unchecked")
239242
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
240243
// Generated using JFormDesigner Evaluation license - cruldra
241-
private void initComponents() {
244+
private void initComponents() throws IOException, UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException {
242245
mainMenu = new JMenuBar();
243246
fileMenu = new JMenu();
244247
jMenuItem1 = new JMenuItem();
@@ -258,7 +261,12 @@ private void initComponents() {
258261
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
259262
setExtendedState(6);
260263
Container contentPane = getContentPane();
261-
264+
Taskbar taskbar = Taskbar.getTaskbar();
265+
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("icon.png");
266+
assert inputStream != null;
267+
BufferedImage iconImage = ImageIO.read(inputStream);
268+
taskbar.setIconImage(iconImage);
269+
// taskbar.setWindowTitle(frame, "My App");
262270
//======== mainMenu ========
263271
{
264272

@@ -394,7 +402,11 @@ private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
394402
/**
395403
* @param args the command line arguments
396404
*/
397-
public static void main(String args[]) {
405+
public static void main(String args[]) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException {
406+
System.setProperty("apple.laf.useScreenMenuBar", "true");
407+
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "WikiTeX");
408+
/*System.setProperty(
409+
"com.apple.mrj.application.apple.menu.about.name", "Name");*/
398410
/* Set the Nimbus look and feel */
399411
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
400412
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
@@ -417,9 +429,16 @@ public static void main(String args[]) {
417429
java.util.logging.Logger.getLogger(PDMViewerApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
418430
}
419431
//</editor-fold>
420-
432+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
421433
/* Create and display the form */
422-
java.awt.EventQueue.invokeLater(() -> new PDMViewerApplication().setVisible(true));
434+
java.awt.EventQueue.invokeLater(() -> {
435+
try {
436+
new PDMViewerApplication().setVisible(true);
437+
} catch (IOException | UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException |
438+
IllegalAccessException e) {
439+
throw new RuntimeException(e);
440+
}
441+
});
423442
}
424443

425444
// Variables declaration - do not modify//GEN-BEGIN:variables

src/org/cruldra/pdmviewer/PDMViewerApplication.jfd renamed to src/main/java/org/cruldra/pdmviewer/PDMViewerApplication.jfd

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/org/cruldra/pdmviewer/models/PDMPhysicalDiagram.java renamed to src/main/java/org/cruldra/pdmviewer/models/PDMPhysicalDiagram.java

File renamed without changes.

src/org/cruldra/pdmviewer/models/PDMReference.java renamed to src/main/java/org/cruldra/pdmviewer/models/PDMReference.java

File renamed without changes.

src/org/cruldra/pdmviewer/models/PDMReferenceJoin.java renamed to src/main/java/org/cruldra/pdmviewer/models/PDMReferenceJoin.java

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)