Author: aadamchik Date: Fri Sep 29 19:57:19 2006 New Revision: 451521 URL: http://svn.apache.org/viewvc?view=rev&rev=451521 Log: adding platform modeler assemblies
Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/pom.xml incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/pom.xml incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/resources/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns (with props) incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXMain.java incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXSetup.java incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/pom.xml incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/ incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/CayenneModeler.ico (with props) Modified: incubator/cayenne/main/trunk/modeler/cayenne-modeler/pom.xml Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/pom.xml URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/pom.xml?view=auto&rev=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/pom.xml (added) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler-java/pom.xml Fri Sep 29 19:57:19 2006 @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2006 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler-parent</artifactId> + <version>3.0-incubating-SNAPSHOT</version> + </parent> + + <artifactId>cayenne-modeler-java</artifactId> + <name>Cayenne Modeler</name> + <packaging>jar</packaging> + + <dependencies> + + <dependency> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler</artifactId> + <version>${version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.objectstyle.woproject.maven2</groupId> + <artifactId>maven-japplication-plugin</artifactId> + <configuration> + <name>CayenneModeler</name> + <mainClass>org.apache.cayenne.modeler.Main</mainClass> + <os>java</os> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>japplication</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/pom.xml URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/pom.xml?view=auto&rev=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/pom.xml (added) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/pom.xml Fri Sep 29 19:57:19 2006 @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2006 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler-parent</artifactId> + <version>3.0-incubating-SNAPSHOT</version> + </parent> + + <artifactId>cayenne-modeler-mac</artifactId> + <name>Cayenne Modeler</name> + <packaging>jar</packaging> + + <dependencies> + + <dependency> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler</artifactId> + <version>${version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.objectstyle.woproject.maven2</groupId> + <artifactId>maven-japplication-plugin</artifactId> + <configuration> + <name>CayenneModeler</name> + <longName>${version}</longName> + <mainClass>org.apache.cayenne.modeler.MacOSXMain</mainClass> + <icon>src/japplication/resources/CayenneModeler.icns</icon> + <os>mac</os> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>japplication</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns?view=auto&rev=451521 ============================================================================== Binary file - no diff available. Propchange: incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXMain.java URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXMain.java?view=auto&rev=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXMain.java (added) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXMain.java Fri Sep 29 19:57:19 2006 @@ -0,0 +1,95 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ + +package org.apache.cayenne.modeler; + +import java.io.File; + +/** + * Main class to start CayenneModeler on MacOSX. + * + * @since 1.2 + * @author Michael Gentry + * @author Andrus Adamchik + */ +public class MacOSXMain extends Main { + + public static final String DEFAULT_LAF_OSX_NAME = "apple.laf.AquaLookAndFeel"; + public static final String DEFAULT_THEME_OSX_NAME = "Aqua"; + + /** + * Main method that starts the CayenneModeler. + */ + public static void main(String[] args) { + MacOSXMain main = new MacOSXMain(); + + // if configured, redirect all logging to the log file + main.configureLogging(); + + // check jdk version + if (!main.checkJDKVersion()) { + System.exit(1); + } + + File projectFile = Main.projectFileFromArgs(args); + main.runModeler(projectFile); + } + + protected static boolean isMacOSX() { + return System.getProperty("os.name").toLowerCase().indexOf("mac") >= 0; + } + + protected void runModeler(File projectFile) { + configureMacOSX(); + super.runModeler(projectFile); + } + + protected void configureMacOSX() { + try { + MacOSXSetup.configureMacOSX(); + } + catch (Exception ex) { + // ignore... not a mac + } + } + + protected String getLookAndFeelName() { + + if (isMacOSX()) { + ModelerPreferences prefs = ModelerPreferences.getPreferences(); + return prefs.getString( + ModelerPreferences.EDITOR_LAFNAME, + MacOSXMain.DEFAULT_LAF_OSX_NAME); + } + else + return super.getLookAndFeelName(); + } + + protected String getThemeName() { + if (isMacOSX()) { + ModelerPreferences prefs = ModelerPreferences.getPreferences(); + return prefs.getString( + ModelerPreferences.EDITOR_THEMENAME, + MacOSXMain.DEFAULT_THEME_OSX_NAME); + } + else { + return super.getThemeName(); + } + } +} Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXSetup.java URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXSetup.java?view=auto&rev=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXSetup.java (added) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler-mac/src/main/java/org/apache/cayenne/modeler/MacOSXSetup.java Fri Sep 29 19:57:19 2006 @@ -0,0 +1,65 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ + + +package org.apache.cayenne.modeler; + +import org.apache.cayenne.modeler.action.AboutAction; +import org.apache.cayenne.modeler.action.ExitAction; +import org.apache.cayenne.modeler.util.CayenneAction; + +import com.apple.eawt.ApplicationAdapter; +import com.apple.eawt.ApplicationEvent; + +/** + * Configures Modeler to better integrate into Mac OS X environment. Has no effect on + * other platforms. + * + * @since 1.1 + * @author Andrus Adamchik + */ +class MacOSXSetup { + + static void configureMacOSX() { + // Application.getApplication().setEnabledPreferencesMenu(true); + com.apple.eawt.Application.getApplication().addApplicationListener( + new MacEventsAdapter()); + } + + static class MacEventsAdapter extends ApplicationAdapter { + + public void handleAbout(ApplicationEvent e) { + if (!e.isHandled()) { + ((AboutAction) getAction(AboutAction.getActionName())).showAboutDialog(); + e.setHandled(true); + } + } + + public void handleQuit(ApplicationEvent e) { + if (!e.isHandled()) { + ((ExitAction) getAction(ExitAction.getActionName())).exit(); + e.setHandled(true); + } + } + + CayenneAction getAction(String name) { + return Application.getInstance().getAction(name); + } + } +} Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/pom.xml URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/pom.xml?view=auto&rev=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/pom.xml (added) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/pom.xml Fri Sep 29 19:57:19 2006 @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2006 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler-parent</artifactId> + <version>3.0-incubating-SNAPSHOT</version> + </parent> + + <artifactId>cayenne-modeler-win</artifactId> + <name>Cayenne Modeler</name> + <packaging>jar</packaging> + + <dependencies> + + <dependency> + <groupId>org.apache.cayenne.modeler</groupId> + <artifactId>cayenne-modeler</artifactId> + <version>${version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.objectstyle.woproject.maven2</groupId> + <artifactId>maven-japplication-plugin</artifactId> + <configuration> + <name>CayenneModeler</name> + <longName>${version}</longName> + <mainClass>org.apache.cayenne.modeler.Main</mainClass> + <icon>src/japplication/resources/CayenneModeler.ico</icon> + <os>windows</os> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>japplication</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Added: incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/CayenneModeler.ico URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/CayenneModeler.ico?view=auto&rev=451521 ============================================================================== Binary file - no diff available. Propchange: incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/CayenneModeler.ico ------------------------------------------------------------------------------ svn:executable = * Propchange: incubator/cayenne/main/trunk/modeler/cayenne-modeler-win/src/japplication/resources/CayenneModeler.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: incubator/cayenne/main/trunk/modeler/cayenne-modeler/pom.xml URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/modeler/cayenne-modeler/pom.xml?view=diff&rev=451521&r1=451520&r2=451521 ============================================================================== --- incubator/cayenne/main/trunk/modeler/cayenne-modeler/pom.xml (original) +++ incubator/cayenne/main/trunk/modeler/cayenne-modeler/pom.xml Fri Sep 29 19:57:19 2006 @@ -96,6 +96,12 @@ <dependency> <groupId>org.apache.cayenne.core</groupId> + <artifactId>cayenne-jdk1.5</artifactId> + <version>${version}</version> + </dependency> + + <dependency> + <groupId>org.apache.cayenne.core</groupId> <artifactId>cayenne-jdk1.4</artifactId> <version>${version}</version> <classifier>tests</classifier>