Revision: 2982
http://sourceforge.net/p/swingme/code/2982
Author: yuranet
Date: 2025-12-24 19:22:08 +0000 (Wed, 24 Dec 2025)
Log Message:
-----------
remove old iPhone theme
Modified Paths:
--------------
SwingMETest/resources/synthdemo/synthDemo.xml
SwingMETest/src/net/yura/mobile/test/MainPane.java
SwingMETest/src/net/yura/mobile/test/MainTest.java
Added Paths:
-----------
SwingMETest/resources/synthdemo/dialog.png
SwingMETest/resources/synthdemo/mainWindow.png
SwingMETest/resources/synthdemo/section.png
Removed Paths:
-------------
SwingMETest/resources/iphone/
Copied: SwingMETest/resources/synthdemo/dialog.png (from rev 2981, SwingMETest/resources/iphone/dialog.png)
===================================================================
(Binary files differ)
Copied: SwingMETest/resources/synthdemo/mainWindow.png (from rev 2981, SwingMETest/resources/iphone/mainWindow.png)
===================================================================
(Binary files differ)
Copied: SwingMETest/resources/synthdemo/section.png (from rev 2981, SwingMETest/resources/iphone/section.png)
===================================================================
(Binary files differ)
Modified: SwingMETest/resources/synthdemo/synthDemo.xml
===================================================================
--- SwingMETest/resources/synthdemo/synthDemo.xml 2025-12-24 18:10:05 UTC (rev 2981)
+++ SwingMETest/resources/synthdemo/synthDemo.xml 2025-12-24 19:22:08 UTC (rev 2982)
@@ -2,6 +2,72 @@
<!DOCTYPE synth SYSTEM "SynthME.dtd">
<synth>
+ <style id="global">
+ <state>
+ <font name="PROPORTIONAL" size="MEDIUM"/>
+ <font path="/font/calibri.fnt">
+ <fontImage path="/font/calibri.png" color="#000000"/>
+ </font>
+<!-- can not use old font format in synth files
+ <font path="/basicfont/font2-med.font"/>
+-->
+ </state>
+ </style>
+ <bind style="global" key=".*"/>
+
+ <style id="tooltip">
+ <state>
+ <color type="BACKGROUND" value="#FFFFFF"/>
+ </state>
+ </style>
+ <bind style="tooltip" key="ToolTip"/>
+
+ <style id="window">
+ <insets top="0" left="0" bottom="0" right="0"/>
+ <state>
+ <imagePainter path="/synthdemo/mainWindow.png" sourceInsets="44 0 44 0" paintCenter="true"/>
+ <color type="FOREGROUND" value="#52425c"/>
+ </state>
+ </style>
+ <bind style="window" key="Frame"/>
+
+ <style id="dialog">
+ <insets top="30" left="30" bottom="30" right="30"/>
+ <state>
+ <imagePainter path="/synthdemo/dialog.png" sourceInsets="30 30 30 30" paintCenter="true"/>
+ <color type="FOREGROUND" value="#FFFFFF"/>
+ </state>
+ </style>
+ <bind style="dialog" key="Dialog"/>
+
+ <style id="softkeys">
+ <insets top="5" left="5" bottom="5" right="5"/>
+ <imageIcon id="button_normal" path="/synthdemo/mainWindow.png" x="0" y="0" width="84" height="44"/>
+ <imageIcon id="bottom_right" path="/synthdemo/mainWindow.png" x="0" y="75" width="84" height="44"/>
+ <imageIcon id="bottom_left" path="/synthdemo/mainWindow.png" x="0" y="75" width="84" height="44"/>
+ <state>
+ <property key="button" value="button_normal"/>
+ <property key="bottomRight" value="bottom_right"/>
+ <property key="bottomLeft" value="bottom_left"/>
+ </state>
+ </style>
+ <bind style="softkeys" key="SoftkeyRenderer"/>
+
+ <style id="section">
+ <insets top="5" left="5" bottom="5" right="5"/>
+ <state>
+ <imagePainter path="/synthdemo/section.png" sourceInsets="12 12 12 12" paintCenter="false"/>
+ <color type="BORDERFILL" value="#ffffff"/>
+ </state>
+ </style>
+ <bind style="section" key="Section"/>
+
+
+
+
+
+
+
<style id="backingStyle">
<state>
<font name="Dialog" size="14"/>
@@ -9,9 +75,8 @@
<color value="#FF0000" type="FOREGROUND"/>
</state>
</style>
- <bind style="backingStyle" key=".*"/>
+ <bind style="backingStyle" key="Menu"/>
-
<style id="scrollpane">
<!--
<imageIcon id="thumb_top" path="/synthdemo/thumb.png" x="0" y="0" width="14" height="14"/>
Modified: SwingMETest/src/net/yura/mobile/test/MainPane.java
===================================================================
--- SwingMETest/src/net/yura/mobile/test/MainPane.java 2025-12-24 18:10:05 UTC (rev 2981)
+++ SwingMETest/src/net/yura/mobile/test/MainPane.java 2025-12-24 19:22:08 UTC (rev 2982)
@@ -16,7 +16,6 @@
*/
package net.yura.mobile.test;
-import java.io.IOException;
import javax.microedition.lcdui.Graphics;
import net.yura.mobile.gui.ActionListener;
import net.yura.mobile.gui.DesktopPane;
@@ -28,8 +27,6 @@
import net.yura.mobile.gui.components.ScrollPane;
import net.yura.mobile.gui.layout.FlowLayout;
import net.yura.mobile.gui.KeyEvent;
-import net.yura.mobile.gui.plaf.LookAndFeel;
-import net.yura.mobile.gui.plaf.nimbus.NimbusLookAndFeel;
import net.yura.mobile.gui.Icon;
import net.yura.mobile.gui.components.Frame;
import net.yura.mobile.gui.components.MenuBar;
@@ -49,34 +46,8 @@
public void initialize() {
- // metal = new MetalLookAndFeel();
- //setLookAndFeel( metal );
- // Hashtable settings = new Hashtable();
- // settings.put("font", new Font("/font/test_0.png", "/font/test.fnt"));
- // settings.put("Button.foreground", new Integer(0xFFff0000));
+ setLookAndFeel( DesktopPane.getSystemLookAndFeelClassName() );
- //setLookAndFeel( new net.yura.android.plaf.AndroidLookAndFeel() );
-
- LookAndFeel lookandfeel=null;
- try {
- if (Application.getPlatform() == Application.PLATFORM_ANDROID) {
- lookandfeel = (LookAndFeel)Class.forName("net.yura.android.plaf.AndroidLookAndFeel").newInstance();
- }
- else if (Application.getPlatform() == Application.PLATFORM_IOS) {
- lookandfeel = (LookAndFeel) Class.forName("net.yura.ios.plaf.IOSLookAndFeel").newInstance();
- }
- //else if (Application.getPlatform() == Application.PLATFORM_BLACKBERRY) {
- // lookandfeel = (LookAndFeel)Class.forName("net.yura.blackberry.plaf.BlackBerryLookAndFeel").newInstance();
- //}
- }
- catch (Throwable ex) {
- ex.printStackTrace();
- }
- if (lookandfeel==null) {
- lookandfeel = new NimbusLookAndFeel(16);
- }
- setLookAndFeel( lookandfeel );
-
mainWindow = new Frame();
mainWindow.setMaximum(true);
@@ -85,11 +56,17 @@
image = new Icon("/world_link.png");
+ //Logger.info("world_link size " + image.getIconWidth() + " x " + image.getIconHeight() + " DIP size : " + toDIP(image.getIconWidth()) + " x " + toDIP(image.getIconHeight()));
+
mainWindow.setMenuBar(new MenuBar());
mainWindow.setUndecorated(true);
mainWindow.setVisible(true);
}
+ public static int toDIP(int size) {
+ return (int) Math.ceil(size / Double.parseDouble(System.getProperty("display.density", "1.0")));
+ }
+
public void setMainSection(Section section) {
section.mainPane = this;
Modified: SwingMETest/src/net/yura/mobile/test/MainTest.java
===================================================================
--- SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-24 18:10:05 UTC (rev 2981)
+++ SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-24 19:22:08 UTC (rev 2982)
@@ -12,7 +12,6 @@
import net.yura.mobile.gui.DesktopPane;
import net.yura.mobile.gui.Font;
import net.yura.mobile.gui.Application;
-import net.yura.mobile.gui.Icon;
import net.yura.mobile.gui.border.CompoundBorder;
import net.yura.mobile.gui.border.LineBorder;
import net.yura.mobile.gui.KeyEvent;
@@ -96,22 +95,21 @@
mainMenu = new Menu("Menu");
//mainMenu.addActionListener(this);
- Button b1 = makeButton("Metal Theme [0]", "metalTheme");
+ Button b1 = makeButton("System Theme [0]", "systemPlaf");
b1.setMnemonic('0');
mainMenu.add(b1);
//addMenuItem(mainMenu,"metalTheme", "Metal Theme");
- addMenuItem(mainMenu,"aether1", "Nimbus Default Theme");
+ addMenuItem(mainMenu,"metalTheme", "Metal Theme");
+ addMenuItem(mainMenu,"aether1", "Nimbus Large Theme");
addMenuItem(mainMenu,"aetherGreen", "Nimbus Green Theme");
addMenuItem(mainMenu,"aether2", "Nimbus Red Theme");
addMenuItem(mainMenu,"aetherCharcoal", "Nimbus Charcoal Theme");
addMenuItem(mainMenu,"synthTheme1", "Synth J2SE Demo");
- addMenuItem(mainMenu,"synthTheme2", "Synth iPhone");
addMenuItem(mainMenu,"synthTheme3", "Synth Visto");
addMenuItem(mainMenu,"synthTheme4", "Synth Telus");
addMenuItem(mainMenu,"synthTheme5", "Synth LG");
addMenuItem(mainMenu,"synthThemeSize", "Synth Size");
-
}
// Override
@@ -190,7 +188,7 @@
}
else if ("aether1".equals(actionCommand)) {
- setupNewLookAndFeel( new NimbusLookAndFeel() );
+ setupNewLookAndFeel( new NimbusLookAndFeel(16) );
}
else if ("aether2".equals(actionCommand)) {
Hashtable styles = new Hashtable();
@@ -224,8 +222,8 @@
else if ("synthTheme1".equals(actionCommand)) {
loadSynthSkin("/synthdemo/synthDemo.xml");
}
- else if ("synthTheme2".equals(actionCommand)) {
- loadSynthSkin("/iphone/synth.xml");
+ else if ("systemPlaf".equals(actionCommand)) {
+ setupNewLookAndFeel(DesktopPane.getSystemLookAndFeelClassName());
}
else if ("synthTheme3".equals(actionCommand)) {
loadSynthSkin("/visto/synthVisto.xml");
@@ -760,5 +758,4 @@
mainWindow.revalidate();
mainWindow.repaint();
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|