Changeset 75
- Timestamp:
- 12/11/07 16:53:08 (1 year ago)
- Files:
-
- trunk/src/vlcskineditor/PreviewWindow.java (modified) (2 diffs)
- trunk/src/vlcskineditor/Skin.java (modified) (5 diffs)
- trunk/src/vlcskineditor/history/AnchorAddEvent.java (added)
- trunk/src/vlcskineditor/history/AnchorEditEvent.java (added)
- trunk/src/vlcskineditor/history/ButtonAddEvent.java (added)
- trunk/src/vlcskineditor/history/ButtonEditEvent.java (added)
- trunk/src/vlcskineditor/history/ItemMoveEvent.java (modified) (1 diff)
- trunk/src/vlcskineditor/history/ThemeEditEvent.java (added)
- trunk/src/vlcskineditor/items/Anchor.java (modified) (2 diffs)
- trunk/src/vlcskineditor/items/Button.java (modified) (2 diffs)
- trunk/src/vlcskineditor/resources/SubBitmap.java (modified) (4 diffs)
- trunk/src/vlcskineditor/resources/SubBitmapEditWindow.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vlcskineditor/PreviewWindow.java
r74 r75 176 176 ime.setNew(); 177 177 m.hist.addEvent(ime); 178 ime = null; 178 179 } 179 180 starteddragging=false; … … 192 193 public void moveItem(int x, int y) { 193 194 try { 195 if(ime==null) { 196 ime = new ItemMoveEvent(selected_item); 197 m.hist.addEvent(ime); 198 } 194 199 selected_item.x+=x; 195 200 selected_item.y+=y; 201 if(ime.getNext()==null) ime.setNew(); 202 else ime = null; 196 203 repaint(); 197 204 } trunk/src/vlcskineditor/Skin.java
r72 r75 23 23 package vlcskineditor; 24 24 25 import vlcskineditor.history.*; 25 26 import vlcskineditor.resources.Bitmap; 26 27 import vlcskineditor.resources.BitmapFont; … … 35 36 36 37 /** 37 * 38 * Represents a skin file. Stores all Resources and Windows, which in turn store the Layouts that contain the items. 38 39 * @author Daniel 39 40 */ … … 50 51 String theme_version = THEME_VERSION_DEFAULT; 51 52 String theme_tooltipfont = THEME_TOOLTIPFONT_DEFAULT; 52 int theme_magnet = THEME_MAGNET_DEFAULT;53 int theme_alpha = THEME_ALPHA_DEFAULT;54 int theme_movealpha = THEME_MOVEALPHA_DEFAULT;53 public int theme_magnet = THEME_MAGNET_DEFAULT; 54 public int theme_alpha = THEME_ALPHA_DEFAULT; 55 public int theme_movealpha = THEME_MOVEALPHA_DEFAULT; 55 56 final String THEMEINFO_NAME_DEFAULT = "Unnamed Theme"; 56 57 final String THEMEINFO_AUTHOR_DEFAULT = "Unknown Author"; 57 58 final String THEMEINFO_EMAIL_DEFAULT = "Unknown"; 58 59 final String THEMEINFO_WEBPAGE_DEFAULT = "http://www.videolan.org/vlc/"; 59 String themeinfo_name = THEMEINFO_NAME_DEFAULT;60 String themeinfo_author = THEMEINFO_AUTHOR_DEFAULT;61 String themeinfo_email = THEMEINFO_EMAIL_DEFAULT;62 String themeinfo_webpage = THEMEINFO_EMAIL_DEFAULT;60 public String themeinfo_name = THEMEINFO_NAME_DEFAULT; 61 public String themeinfo_author = THEMEINFO_AUTHOR_DEFAULT; 62 public String themeinfo_email = THEMEINFO_EMAIL_DEFAULT; 63 public String themeinfo_webpage = THEMEINFO_EMAIL_DEFAULT; 63 64 File skinfile; 64 65 public String skinfolder; … … 335 336 return; 336 337 } 338 ThemeEditEvent tee = new ThemeEditEvent(this); 337 339 themeinfo_name = themeinfo_name_tf.getText(); 338 340 themeinfo_author = themeinfo_author_tf.getText(); … … 343 345 theme_movealpha = Integer.parseInt(theme_movealpha_tf.getText()); 344 346 theme_frame.setVisible(false); 347 tee.setNew(); 348 m.hist.addEvent(tee); 345 349 } 346 350 else if(e.getSource().equals(theme_help_btn)) { trunk/src/vlcskineditor/history/ItemMoveEvent.java
r74 r75 37 37 public ItemMoveEvent(Item ite) { 38 38 i = ite; 39 x_ old = i.x;40 y_old = i.y;39 x_new = x_old = i.x; 40 x_new = y_old = i.y; 41 41 } 42 42 public void setNew() { trunk/src/vlcskineditor/items/Anchor.java
r71 r75 24 24 25 25 import vlcskineditor.*; 26 import vlcskineditor.history.*; 26 27 import java.awt.*; 27 28 import java.awt.event.*; … … 94 95 } 95 96 public void update() { 96 id=id_tf.getText(); 97 priority=Integer.parseInt(priority_tf.getText()); 98 lefttop=lefttop_cb.getSelectedItem().toString(); 99 x=Integer.parseInt(x_tf.getText()); 100 y=Integer.parseInt(y_tf.getText()); 101 points=points_tf.getText(); 102 range=Integer.parseInt(range_tf.getText()); 103 updateBezier(); 104 s.updateItems(); 105 s.expandItem(id); 106 frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE); 107 created = true; 97 if(!created) { 98 id=id_tf.getText(); 99 priority=Integer.parseInt(priority_tf.getText()); 100 lefttop=lefttop_cb.getSelectedItem().toString(); 101 x=Integer.parseInt(x_tf.getText()); 102 y=Integer.parseInt(y_tf.getText()); 103 points=points_tf.getText(); 104 range=Integer.parseInt(range_tf.getText()); 105 updateBezier(); 106 s.updateItems(); 107 s.expandItem(id); 108 frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE); 109 created = true; 110 AnchorAddEvent aae = new AnchorAddEvent(s.getParentListOf(id),this); 111 } 112 else { 113 AnchorEditEvent aee = new AnchorEditEvent(this); 114 id=id_tf.getText(); 115 priority=Integer.parseInt(priority_tf.getText()); 116 lefttop=lefttop_cb.getSelectedItem().toString(); 117 x=Integer.parseInt(x_tf.getText()); 118 y=Integer.parseInt(y_tf.getText()); 119 points=points_tf.getText(); 120 range=Integer.parseInt(range_tf.getText()); 121 updateBezier(); 122 s.updateItems(); 123 s.expandItem(id); 124 aee.setNew(); 125 } 108 126 } 109 127 public void showOptions() { trunk/src/vlcskineditor/items/Button.java
r71 r75 24 24 25 25 import vlcskineditor.*; 26 import vlcskineditor.history.*; 26 27 import java.awt.*; 27 28 import java.awt.event.*; … … 79 80 } 80 81 public void update() { 81 id = id_tf.getText(); 82 x = Integer.parseInt(x_tf.getText()); 83 y = Integer.parseInt(y_tf.getText()); 84 lefttop = lefttop_cb.getSelectedItem().toString(); 85 rightbottom = rightbottom_cb.getSelectedItem().toString(); 86 xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); 87 ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); 88 visible = visible_tf.getText(); 89 help = help_tf.getText(); 90 91 up = up_tf.getText(); 92 over = over_tf.getText(); 93 down = down_tf.getText(); 94 action = action_tf.getText(); 95 tooltiptext = tooltiptext_tf.getText(); 96 97 s.updateItems(); 98 s.expandItem(id); 99 frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE); 100 created = true; 82 if(!created) { 83 id = id_tf.getText(); 84 x = Integer.parseInt(x_tf.getText()); 85 y = Integer.parseInt(y_tf.getText()); 86 lefttop = lefttop_cb.getSelectedItem().toString(); 87 rightbottom = rightbottom_cb.getSelectedItem().toString(); 88 xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); 89 ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); 90 visible = visible_tf.getText(); 91 help = help_tf.getText(); 92 93 up = up_tf.getText(); 94 over = over_tf.getText(); 95 down = down_tf.getText(); 96 action = action_tf.getText(); 97 tooltiptext = tooltiptext_tf.getText(); 98 99 ButtonAddEvent bae = new ButtonAddEvent(s.getParentListOf(id),this); 100 s.m.hist.addEvent(bae); 101 102 s.updateItems(); 103 s.expandItem(id); 104 frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE); 105 created = true; 106 } 107 else { 108 ButtonEditEvent bee = new ButtonEditEvent(this); 109 id = id_tf.getText(); 110 x = Integer.parseInt(x_tf.getText()); 111 y = Integer.parseInt(y_tf.getText()); 112 lefttop = lefttop_cb.getSelectedItem().toString(); 113 rightbottom = rightbottom_cb.getSelectedItem().toString(); 114 xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); 115 ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); 116 visible = visible_tf.getText(); 117 help = help_tf.getText(); 118 119 up = up_tf.getText(); 120 over = over_tf.getText(); 121 down = down_tf.getText(); 122 action = action_tf.getText(); 123 tooltiptext = tooltiptext_tf.getText(); 124 125 bee.setNew(); 126 s.m.hist.addEvent(bee); 127 128 s.updateItems(); 129 s.expandItem(id); 130 } 101 131 } 102 132 public void showOptions() { trunk/src/vlcskineditor/resources/SubBitmap.java
r71 r75 58 58 boolean created = false; 59 59 60 SubBitmapEditWindow sbew = null; 61 60 62 /** 61 63 * Creates a new SubBitmap from XML. … … 236 238 fps_tf.setText(String.valueOf(fps)); 237 239 frame.setVisible(true); 240 sbew = new SubBitmapEditWindow(parent,this); 238 241 } 239 242 public void actionPerformed(ActionEvent e) { … … 258 261 } 259 262 frame.setVisible(false); 263 sbew.frame.setVisible(false); 264 sbew.frame = null; 265 sbew = null; 260 266 update(); 261 267 } … … 277 283 else if(e.getSource().equals(cancel_btn)) { 278 284 frame.setVisible(false); 279 if(!created) parent.SubBitmaps.remove(this); 285 sbew.frame.setVisible(false); 286 sbew.frame = null; 287 sbew = null; 288 if(!created) parent.SubBitmaps.remove(this); 280 289 } 281 290 }
