mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
add action bar to mac os as a separate component
This commit is contained in:
@@ -3241,5 +3241,21 @@
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
<org.diylc.appframework.update.Version>
|
||||
<versionNumber>
|
||||
<major>4</major>
|
||||
<minor>11</minor>
|
||||
<build>0</build>
|
||||
</versionNumber>
|
||||
<releaseDate>2020-11-19 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>macOS: added quick action toolbar that was already available for other platforms</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
</a>
|
||||
</java.util.Arrays_-ArrayList>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<property name="jar.dir" value="${build.dir}/jar" />
|
||||
<property name="report.dir" value="${build.dir}/junitreport" />
|
||||
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
||||
<property name="diylc.version" value="4.10.0" />
|
||||
<property name="diylc.version" value="4.11.0" />
|
||||
|
||||
<property name="osx.jre8.path" value="jre\osx\jdk8u275-b01-jre\Contents\Home\" />
|
||||
|
||||
|
||||
@@ -249,25 +249,26 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
Container c = new Container();
|
||||
c.setLayout(new BorderLayout());
|
||||
|
||||
centerPanel = new JPanel(new BorderLayout());
|
||||
centerPanel = new JPanel();
|
||||
centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS));
|
||||
c.add(centerPanel, BorderLayout.CENTER);
|
||||
|
||||
topPanel = new JPanel();
|
||||
topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS));
|
||||
c.add(topPanel, BorderLayout.NORTH);
|
||||
|
||||
leftPanel = new JPanel();
|
||||
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.X_AXIS));
|
||||
c.add(leftPanel, BorderLayout.WEST);
|
||||
c.add(leftPanel, BorderLayout.WEST);
|
||||
|
||||
rightPanel = new JPanel();
|
||||
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.X_AXIS));
|
||||
c.add(rightPanel, BorderLayout.EAST);
|
||||
|
||||
topPanel = new JPanel();
|
||||
topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS));
|
||||
c.add(topPanel, BorderLayout.NORTH);
|
||||
|
||||
bottomPanel = new JPanel();
|
||||
bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.Y_AXIS));
|
||||
c.add(bottomPanel, BorderLayout.SOUTH);
|
||||
|
||||
rightPanel = new JPanel();
|
||||
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.X_AXIS));
|
||||
c.add(rightPanel, BorderLayout.EAST);
|
||||
|
||||
setContentPane(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,12 @@ import javax.swing.BorderFactory;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.diylc.appframework.miscutils.Utils;
|
||||
import org.diylc.common.BadPositionException;
|
||||
import org.diylc.common.EventType;
|
||||
import org.diylc.common.IComponentTransformer;
|
||||
import org.diylc.common.IPlugIn;
|
||||
@@ -43,6 +46,7 @@ import org.diylc.swing.images.IconLoader;
|
||||
import org.diylc.lang.LangUtil;
|
||||
import org.diylc.swing.ActionFactory;
|
||||
import org.diylc.swing.ISwingUI;
|
||||
import org.diylc.swing.plugins.canvas.CanvasPlugin;
|
||||
import org.diylc.swing.plugins.help.HelpMenuPlugin;
|
||||
|
||||
/**
|
||||
@@ -51,6 +55,8 @@ import org.diylc.swing.plugins.help.HelpMenuPlugin;
|
||||
* @author Branislav Stojkovic
|
||||
*/
|
||||
public class ActionBarPlugin implements IPlugIn {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ActionBarPlugin.class);
|
||||
|
||||
private IPlugInPort plugInPort;
|
||||
private ISwingUI swingUI;
|
||||
@@ -176,7 +182,15 @@ public class ActionBarPlugin implements IPlugIn {
|
||||
@Override
|
||||
public void connect(IPlugInPort plugInPort) {
|
||||
this.plugInPort = plugInPort;
|
||||
swingUI.injectMenuComponent(getActionPanel());
|
||||
if (Utils.isMac()) {
|
||||
try {
|
||||
swingUI.injectGUIComponent(getActionPanel(), SwingConstants.CENTER, false);
|
||||
} catch (BadPositionException e) {
|
||||
LOG.error("Could not inject action bar plugin", e);
|
||||
}
|
||||
}
|
||||
else
|
||||
swingUI.injectMenuComponent(getActionPanel());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user