Author: echatellier Date: 2012-04-12 15:37:36 +0200 (Thu, 12 Apr 2012) New Revision: 3361 Url: http://chorem.org/repositories/revision/lima/3361 Log: New killer feature : beta version layer Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java 2012-04-12 13:37:36 UTC (rev 3361) @@ -0,0 +1,76 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.ui; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; + +import javax.swing.JComponent; + +import org.jdesktop.jxlayer.JXLayer; +import org.jdesktop.jxlayer.plaf.AbstractLayerUI; + +/** + * Layer qui affiche "beta version". + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class BetaLayerUI extends AbstractLayerUI<JComponent> { + + /** serialVersionUID. */ + private static final long serialVersionUID = 309245880711380974L; + + @Override + protected void paintLayer(Graphics2D g2, JXLayer<? extends JComponent> l) { + super.paintLayer(g2, l); + + // position + //g2.translate(-35, 90); // top left + g2.translate(l.getBounds().getMaxX() - 140, l.getBounds().getMaxY()); // bottom right + + // yellow backgroung + g2.rotate(Math.PI * -42 / 180); + g2.setColor(Color.YELLOW); + g2.fillRect(10, 10, 170, 30); + + // text + g2.translate(30, 15); + g2.setFont(new Font("Dialog", Font.BOLD, 16)); + g2.setColor(Color.BLACK); + g2.drawString("Beta version",10,10); + + // for test only + g2.translate(15, 10); + g2.setFont(new Font("Dialog", Font.ITALIC, 10)); + g2.setColor(Color.BLACK); + g2.drawString("(for test only)",10,10); + } +} Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2012-04-11 16:14:23 UTC (rev 3360) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2012-04-12 13:37:36 UTC (rev 3361) @@ -41,6 +41,10 @@ <script><![CDATA[ + void $afterCompleteSetup() { + SwingUtil.getLayer(mainPanel).setUI(betaLayer); + } + public LimaConfig getConfig() { return LimaContext.CONFIG_DEF.getContextValue(getDelegateContext()); } @@ -220,7 +224,8 @@ </JMenu> </JMenu> </JMenuBar> - <JPanel layout='{new BorderLayout()}'> + <BetaLayerUI id="betaLayer" /> + <JPanel id="mainPanel" layout='{new BorderLayout()}' decorator="boxed"> <JTabbedPane id="contentTabbedPane" constraints="BorderLayout.CENTER"/> </JPanel>
participants (1)
-
echatellier@users.chorem.org