Bladeren bron

UI fix für wurstfinger

LH 6 jaren geleden
bovenliggende
commit
5f3610b2f5

+ 3 - 3
iZplPlugins/JukeBox/src/main/java/de/nplusc/izc/izpl/plugins/jukebox/JukeBox.form

@@ -36,7 +36,7 @@
                       <EmptySpace max="-2" attributes="0"/>
                       <Component id="btnReload" max="32767" attributes="0"/>
                   </Group>
-                  <Component id="jScrollPane1" alignment="0" pref="468" max="32767" attributes="0"/>
+                  <Component id="tablePane" alignment="0" pref="468" max="32767" attributes="0"/>
                   <Group type="102" attributes="0">
                       <Component id="btnPlayPause" min="-2" pref="221" max="-2" attributes="0"/>
                       <EmptySpace type="unrelated" max="-2" attributes="0"/>
@@ -57,7 +57,7 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="jScrollPane1" pref="497" max="32767" attributes="0"/>
+              <Component id="tablePane" pref="497" max="32767" attributes="0"/>
               <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" max="-2" attributes="0">
                   <Component id="btnEnqueue" max="32767" attributes="0"/>
@@ -83,7 +83,7 @@
     </DimensionLayout>
   </Layout>
   <SubComponents>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+    <Container class="javax.swing.JScrollPane" name="tablePane">
       <AuxValues>
         <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
       </AuxValues>

+ 17 - 5
iZplPlugins/JukeBox/src/main/java/de/nplusc/izc/izpl/plugins/jukebox/JukeBox.java

@@ -13,6 +13,7 @@ import de.nplusc.izc.iZpl.API.shared.InvalidPlayListFileException;
 import de.nplusc.izc.iZpl.API.shared.PlayListItem;
 import de.nplusc.izc.tools.baseTools.Detectors;
 import de.nplusc.izc.tools.baseTools.HidableTableColumnModel;
+import java.awt.Dimension;
 import java.awt.EventQueue;
 import java.awt.Image;
 import java.awt.event.ActionEvent;
@@ -27,7 +28,9 @@ import javax.swing.ActionMap;
 import javax.swing.DefaultListModel;
 import javax.swing.InputMap;
 import javax.swing.JComponent;
+import javax.swing.JLabel;
 import javax.swing.KeyStroke;
+import javax.swing.ScrollPaneConstants;
 import javax.swing.table.DefaultTableModel;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -57,7 +60,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     private void initComponents()
     {
 
-        jScrollPane1 = new javax.swing.JScrollPane();
+        tablePane = new javax.swing.JScrollPane();
         tblPLE = new javax.swing.JTable();
         jScrollPane2 = new javax.swing.JScrollPane();
         lstScheduled = new javax.swing.JList();
@@ -99,7 +102,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         });
         tblPLE.setColumnModel (new HidableTableColumnModel(tblPLE.getColumnModel()));
         tblPLE.getTableHeader().setReorderingAllowed(false);
-        jScrollPane1.setViewportView(tblPLE);
+        tablePane.setViewportView(tblPLE);
 
         lstScheduled.setModel(new DefaultListModel<String>());
         jScrollPane2.setViewportView(lstScheduled);
@@ -163,7 +166,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
                         .addComponent(btnEnqueue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(btnReload, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
+                    .addComponent(tablePane, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
                     .addGroup(layout.createSequentialGroup()
                         .addComponent(btnPlayPause, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@@ -179,7 +182,7 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
+                .addComponent(tablePane, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                     .addComponent(btnEnqueue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -317,12 +320,12 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
     private javax.swing.JButton btnPlayPause;
     private javax.swing.JButton btnReload;
     private javax.swing.JButton btnSkip;
-    private javax.swing.JScrollPane jScrollPane1;
     private javax.swing.JScrollPane jScrollPane2;
     private javax.swing.JLabel lblStatus;
     private javax.swing.JLabel lblTrackName;
     private javax.swing.JList lstScheduled;
     private javax.swing.JSlider seekBar;
+    private javax.swing.JScrollPane tablePane;
     private javax.swing.JTable tblPLE;
     // End of variables declaration//GEN-END:variables
 
@@ -414,7 +417,16 @@ public class JukeBox extends javax.swing.JFrame implements UIPlugin,MouseListene
         }
         setIconImage(IZPLApi.getProgramIcon());
         initComponents();
+        JLabel tmp = new JLabel("  "); //HACK incoming
+        tmp.setMinimumSize(new Dimension(30, 30));
+        tmp.setMaximumSize(new Dimension(30, 30));
+        tmp.setPreferredSize(new Dimension(30, 30));
+        tablePane.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, tmp);
+        tablePane.getVerticalScrollBar().setPreferredSize(
+            new Dimension(30, Integer.MAX_VALUE));
+        this.pack();
         
+        //END HACK
         mdl=(HidableTableColumnModel) tblPLE.getColumnModel();
         mdl.setColumnVisible(mdl.getColumn(0), false);
         //most probably "embedded" device.

+ 5 - 4
izpl-shared/src/main/java/de/nplusc/izc/iZpl/Utils/shared/PLFileIO.java

@@ -392,17 +392,18 @@ public class PLFileIO
         List<SinglePlayListItem> rootList = readSingleList(path,folderHandler).getData();
         try{
             Class izplapi = Class.forName("de.nplusc.izc.iZpl.API.IZPLApi");
-            Method m = izplapi.getMethod("isVerboseMode", null);
-            if((Boolean)m.invoke(null, null))
+            Method m = izplapi.getMethod("isVerboseMode", (Class) null);
+            if((Boolean)m.invoke(null, (Object) null))
             {
                 Class yaml = Class.forName("org.yaml.snakeyaml.Yaml");
                 Object y = yaml.getConstructor().newInstance();
                 l.trace(yaml.getMethod("dump", Object.class).invoke(y, rootList));
             }
         }
-        catch(Exception e)
+        catch(ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | InstantiationException e)
         {
-            // nothing since the exception means that Yaml doesnt work here. And that code is debugging only
+            // nothing since the exception means that Yaml doesnt work here 
+            //or izpl core is not loaded. And that code is debugging only
         }
         for (SinglePlayListItem re : rootList)
         {