Commit 8f511e9b authored by Nico Mack's avatar Nico Mack

Minor changes to display of Tulip Package Information

parent 1fdc6612
......@@ -20,6 +20,8 @@ import lu.list.itis.dkd.tui.utility.ManifestReader;
import lu.list.itis.dkd.tui.utility.StringUtils;
import lu.list.itis.dkd.tui.utility.TulipPackage;
import com.jgoodies.common.base.Strings;
/**
* @author mack
* @since [major].[minor]
......@@ -101,7 +103,13 @@ public class TulipCore implements TulipPackage {
@Override
public String toString() {
return StringUtils.build("{} - {} ({} | {})", getName(), getVersion(), getBuildDate(), getBuildNumber()); //$NON-NLS-1$
String buildDate = getBuildDate();
String buildNumber = getBuildNumber();
if (Strings.isNotBlank(buildDate) && Strings.isNotBlank(buildNumber)) {
return StringUtils.build("{} - {} ({} | {})", getName(), getVersion(), buildDate, buildNumber); //$NON-NLS-1$
}
return StringUtils.build("{} - {}", getName(), getVersion()); //$NON-NLS-1$
}
}
......@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Image;
import java.awt.image.BufferedImage;
......@@ -75,8 +76,8 @@ public class SplashScreen extends JPanel implements LogListener {
private static final Logger LOGGER = LoggerFactory.getLogger(SplashScreen.class.getSimpleName());
private static final String LOGO_PATH = "resources/TULIP.png"; //$NON-NLS-1$
private static final String COLUMN_SPECS = "5dlu, left:pref, 5dlu, 60dlu:grow,5dlu"; //$NON-NLS-1$
private static final String ROW_SPECS = "5dlu,center:300dlu:grow, 5dlu, bottom:300dlu:grow,5dlu"; //$NON-NLS-1$
private static final String COLUMN_SPECS = "5dlu, left:pref, 5dlu, 60dlu:grow, 5dlu"; //$NON-NLS-1$
private static final String ROW_SPECS = "5dlu, center:300dlu, 5dlu, top:pref:grow,5dlu"; //$NON-NLS-1$
// ---------------------------------------------------------------------------
// ***************************************************************************
......@@ -88,6 +89,7 @@ public class SplashScreen extends JPanel implements LogListener {
logo = this.getImage(TangibleApplication.class, LOGO_PATH);
this.setLayout(new FormLayout(COLUMN_SPECS, ROW_SPECS));
this.setBackground(Color.BLACK);
this.setSize(new Dimension(screenWidth, screenHeight));
this.setPreferredSize(new Dimension(screenWidth, screenHeight));
CellConstraints constraints = new CellConstraints();
......@@ -109,33 +111,40 @@ public class SplashScreen extends JPanel implements LogListener {
logScroller.setAutoscrolls(true);
logScroller.setOpaque(false);
logScroller.getViewport().setOpaque(false);
logScroller.setPreferredSize(new Dimension(screenWidth, screenHeight / 2));
this.add(logScroller, constraints.xywh(2, 4, 3, 1));
FontMetrics metrics = log.getFontMetrics(log.getFont());
int columns = (int) (screenWidth / (metrics.charWidth('A') * 1.4));
int rows = screenHeight / (2 * metrics.getHeight());
log.setColumns(columns);
log.setRows(rows);
about = new JTextArea();
about.setLineWrap(false);
about.setOpaque(false);
about.setForeground(Color.LIGHT_GRAY);
about.setEditable(false);
about.setColumns(40);
about.setRows(10);
Font aboutFont = new Font("Arial", Font.BOLD, 16);
metrics = about.getFontMetrics(aboutFont);
columns = (int) (screenWidth / 2 * (metrics.charWidth('A') * 1.4));
rows = (int) ((0.8 * screenHeight) / (2 * metrics.getHeight()));
about.setFont(aboutFont);
about.setColumns(columns);
about.setRows(rows);
aboutScroller = new JScrollPane(about);
aboutScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
aboutScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
aboutScroller.setAutoscrolls(true);
aboutScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
aboutScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
aboutScroller.setAutoscrolls(false);
aboutScroller.setOpaque(false);
aboutScroller.getViewport().setOpaque(false);
this.add(aboutScroller, constraints.xywh(4, 2, 1, 1));
FontMetrics metrics = log.getFontMetrics(log.getFont());
int columns = (int) (screenWidth / (metrics.charWidth('A') * 1.4));
int rows = screenHeight / (2 * metrics.getHeight());
log.setColumns(columns);
log.setRows(rows);
appender = OnScreenLogAppender.getInstance("SplashScreen");
appender.addLogListener(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment