Changeset 75

Show
Ignore:
Timestamp:
12/11/07 16:53:08 (1 year ago)
Author:
altglass
Message:

More adding/editing event support, SubBitmap? editor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vlcskineditor/PreviewWindow.java

    r74 r75  
    176176      ime.setNew(); 
    177177      m.hist.addEvent(ime); 
     178      ime = null; 
    178179    } 
    179180    starteddragging=false; 
     
    192193  public void moveItem(int x, int y) {     
    193194    try { 
     195      if(ime==null) { 
     196        ime = new ItemMoveEvent(selected_item); 
     197        m.hist.addEvent(ime); 
     198      }       
    194199      selected_item.x+=x; 
    195200      selected_item.y+=y; 
     201      if(ime.getNext()==null) ime.setNew(); 
     202      else ime = null; 
    196203      repaint(); 
    197204    } 
  • trunk/src/vlcskineditor/Skin.java

    r72 r75  
    2323package vlcskineditor; 
    2424 
     25import vlcskineditor.history.*; 
    2526import vlcskineditor.resources.Bitmap; 
    2627import vlcskineditor.resources.BitmapFont; 
     
    3536 
    3637/** 
    37  * 
     38 * Represents a skin file. Stores all Resources and Windows, which in turn store the Layouts that contain the items. 
    3839 * @author Daniel 
    3940 */ 
     
    5051  String theme_version = THEME_VERSION_DEFAULT; 
    5152  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; 
    5556  final String THEMEINFO_NAME_DEFAULT = "Unnamed Theme"; 
    5657  final String THEMEINFO_AUTHOR_DEFAULT = "Unknown Author"; 
    5758  final String THEMEINFO_EMAIL_DEFAULT = "Unknown"; 
    5859  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; 
    6364  File skinfile; 
    6465  public String skinfolder; 
     
    335336        return; 
    336337      } 
     338      ThemeEditEvent tee = new ThemeEditEvent(this); 
    337339      themeinfo_name = themeinfo_name_tf.getText(); 
    338340      themeinfo_author = themeinfo_author_tf.getText(); 
     
    343345      theme_movealpha = Integer.parseInt(theme_movealpha_tf.getText()); 
    344346      theme_frame.setVisible(false); 
     347      tee.setNew(); 
     348      m.hist.addEvent(tee); 
    345349    } 
    346350    else if(e.getSource().equals(theme_help_btn)) { 
  • trunk/src/vlcskineditor/history/ItemMoveEvent.java

    r74 r75  
    3737  public ItemMoveEvent(Item ite) { 
    3838    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; 
    4141  } 
    4242  public void setNew() { 
  • trunk/src/vlcskineditor/items/Anchor.java

    r71 r75  
    2424 
    2525import vlcskineditor.*; 
     26import vlcskineditor.history.*; 
    2627import java.awt.*; 
    2728import java.awt.event.*; 
     
    9495  } 
    9596  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    }    
    108126  } 
    109127  public void showOptions() { 
  • trunk/src/vlcskineditor/items/Button.java

    r71 r75  
    2424 
    2525import vlcskineditor.*; 
     26import vlcskineditor.history.*; 
    2627import java.awt.*; 
    2728import java.awt.event.*; 
     
    7980  } 
    8081  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    } 
    101131  } 
    102132  public void showOptions() { 
  • trunk/src/vlcskineditor/resources/SubBitmap.java

    r71 r75  
    5858  boolean created = false; 
    5959   
     60  SubBitmapEditWindow sbew = null; 
     61   
    6062  /** 
    6163   * Creates a new SubBitmap from XML. 
     
    236238    fps_tf.setText(String.valueOf(fps)); 
    237239    frame.setVisible(true);     
     240    sbew = new SubBitmapEditWindow(parent,this);     
    238241  } 
    239242  public void actionPerformed(ActionEvent e) { 
     
    258261      } 
    259262      frame.setVisible(false); 
     263      sbew.frame.setVisible(false); 
     264      sbew.frame = null; 
     265      sbew = null; 
    260266      update();       
    261267    } 
     
    277283    else if(e.getSource().equals(cancel_btn)) { 
    278284      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);       
    280289    } 
    281290  }