Author: tchemit Date: 2008-02-07 17:10:42 +0000 (Thu, 07 Feb 2008) New Revision: 733 Modified: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUIRefreshHelper.java trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx Log: optimisation ui Modified: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUIRefreshHelper.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUIRefreshHelper.java 2008-02-07 17:10:09 UTC (rev 732) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUIRefreshHelper.java 2008-02-07 17:10:42 UTC (rev 733) @@ -309,14 +309,22 @@ ui.getDetailHeader().setText(_("simexplorer.node.detail", selectedNode.getMetaData().getName(), model.getSelectedVersion())); ui.getDetailDescriptorsHeader().setText(_("simexplorer.node.descriptors", detail.getDescriptors().size())); ui.getDetailType().setText(detail.getType()); - ui.getDetailDescription().setText(detail.getDescription()); + String s = detail.getDescription(); + String tooltip = s; + if (s.length()>32) { + s = s.substring(0,32)+"..."; + } + ui.getDetailDescription().setText(s); + if (!s.equals(tooltip)) { + ui.getDetailDescription().setToolTipText(tooltip); + } ui.getDetailCreationDate().setText(DATE_FORMAT.format(detail.getCreationDate())); ui.getDetail().setVisible(true); JTable table = ui.getDetailTable(); ((JDetailTableModel) table.getModel()).setData(detail); int nbRows = table.getRowCount() + 1; - if (nbRows > 11) { - nbRows = 11; + if (nbRows > 6) { + nbRows = 6; } ui.getScrollTable().setPreferredSize(new Dimension((int) table.getSize().getWidth(), 2 + (nbRows * (4 + table.getFont().getSize())))); List<Attachment> attachments = detail.getAttachments(); @@ -336,8 +344,8 @@ } listAttachments.setSelectedIndex(0); nbRows = listModel.getSize(); - if (nbRows > 10) { - nbRows = 10; + if (nbRows > 5) { + nbRows = 5; } Dimension dimHead = ui.getDetailHeaderAttachmentsPanel().getPreferredSize(); listAttachments.setVisible(true); Modified: trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx =================================================================== --- trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-07 17:10:09 UTC (rev 732) +++ trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-07 17:10:42 UTC (rev 733) @@ -1,5 +1,5 @@ <JFrame name="mainFrame" title='{_("simexplorer.main.ui.title")}' - defaultCloseOperation='DISPOSE_ON_CLOSE' width='900' height='720'> + defaultCloseOperation='DISPOSE_ON_CLOSE' width='700' height='525'> <script> import static org.codelutin.i18n.I18n._; import static jaxx.runtime.UIHelper.createImageIcon; Modified: trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx =================================================================== --- trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx 2008-02-07 17:10:09 UTC (rev 732) +++ trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx 2008-02-07 17:10:42 UTC (rev 733) @@ -20,7 +20,7 @@ <JLabel id='detailHeader' text='{_("simexplorer.node.nodetail")}'/> </JPanel> </cell> - </row> + </row> <row> <cell fill='vertical'> <JPanel id='detailHeaderAttachmentsPanel' background='{Color.WHITE}' border='{javax.swing.border.LineBorder.createBlackLineBorder()}'> @@ -34,13 +34,13 @@ <JScrollPane columnHeaderView='{toolbar}'> <JTree id="navigationTree" model='{new javax.swing.tree.DefaultTreeModel(null)}'/> </JScrollPane> - <JScrollPane id="scrollPane" columnHeaderView='{detailHeaderPanel}'> + <JScrollPane id="scrollPane" columnHeaderView='{detailHeaderPanel}' border='{null}' horizontalScrollBarPolicy='horizontal_scrollbar_never' verticalScrollBarPolicy='vertical_scrollbar_never'> <Table id='detail' insets='2,2,2,1'> <row fill='vertical'> <cell anchor='west'> <JLabel text='{_("simexplorer.common.type")}'/> </cell> - <cell weightx="1" anchor='east'> + <cell weightx="1" anchor='west'> <JLabel id='detailType'/> </cell> </row> @@ -48,7 +48,7 @@ <cell anchor='west'> <JLabel text='{_("simexplorer.common.version")}'/> </cell> - <cell weightx="1" anchor='east'> + <cell weightx="1" anchor='west'> <JComboBox id='detailVersions' model='{new DefaultComboBoxModel()}'/> </cell> </row> @@ -56,7 +56,7 @@ <cell anchor='west'> <JLabel text='{_("simexplorer.common.description")}'/> </cell> - <cell weightx="1" anchor='east'> + <cell weightx="1" anchor='west'> <JLabel id='detailDescription'/> </cell> </row> @@ -64,34 +64,34 @@ <cell anchor='west'> <JLabel text='{_("simexplorer.common.creationDate")}'/> </cell> - <cell anchor='east'> + <cell anchor='west'> <JLabel id='detailCreationDate'/> </cell> </row> <row> <cell fill='both' columns="2"> - <JPanel background='{Color.WHITE}' border='{javax.swing.border.LineBorder.createBlackLineBorder()}'> + <JPanel id='detailDescriptorsHeaderPanel' background='{Color.WHITE}' border='{javax.swing.border.LineBorder.createBlackLineBorder()}'> <JLabel id='detailDescriptorsHeader'/> </JPanel> </cell> </row> <row> - <cell columns='2' fill='horizontal'> - <JScrollPane id='scrollTable'> + <cell fill='horizontal' columns="2"> + <JScrollPane id='scrollTable' horizontalScrollBarPolicy='horizontal_scrollbar_as_needed' verticalScrollBarPolicy='vertical_scrollbar_as_needed'> <JTable id="detailTable" model='{new fr.cemagref.simexplorer.is.ui.swing.model.JDetailTableModel()}' focusable='false' enabled='false'/> </JScrollPane> </cell> </row> <row> - <cell columns='2' fill='horizontal'> - <JScrollPane id='scrollAttachments' columnHeaderView='{detailHeaderAttachmentsPanel}'> + <cell fill='horizontal' columns="2"> + <JScrollPane id='scrollAttachments' columnHeaderView='{detailHeaderAttachmentsPanel}' horizontalScrollBarPolicy='horizontal_scrollbar_as_needed' verticalScrollBarPolicy='vertical_scrollbar_as_needed'> <JList id="detailAttachments" model='{new DefaultListModel()}'/> </JScrollPane> </cell> </row> <row weighty="1" weightx="2"> - <cell fill='both' columns='2'> + <cell fill='both'> <JPanel> <JLabel text=''/> </JPanel>
participants (1)
-
tchemit@users.labs.libre-entreprise.org