Skip to content
Permalink
Browse files
Switched System.out.println() to Log4J.
  • Loading branch information
mrg committed Sep 13, 2016
1 parent f26e1a3 commit e507b8d518629c52d4f3bcf84ee132c8699fda92
Showing 17 changed files with 159 additions and 53 deletions.
10 pom.xml
@@ -30,6 +30,7 @@
<properties>
<cayenne.version>4.0.M3</cayenne.version>
<fontawesomefx.version>8.9</fontawesomefx.version>
<java.version>1.8</java.version>
<jfxtras.version>8.0-r4</jfxtras.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -41,8 +42,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
@@ -55,6 +56,11 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-server</artifactId>
@@ -33,19 +33,25 @@
import org.apache.cayenne.modeler.layout.SplashLayout;
import org.apache.cayenne.modeler.project.CayenneProject;
import org.apache.cayenne.project.CayenneProjectModule;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javafx.application.Application;
import javafx.stage.Stage;

public class CayenneModeler extends Application
{
private static final Log LOGGER = LogFactory.getLog(CayenneModeler.class);
// private static final Logger LOGGER = LogManager.getLogger(CayenneModeler.class);

// private Stage primaryStage;
private SplashLayout splashLayout;
// private BorderPane rootLayout;

@Override
public void start(final Stage primaryStage) throws Exception
{
LOGGER.info("Starting modeler...");
// this.primaryStage = primaryStage;


@@ -24,9 +24,13 @@
import java.util.List;

import org.apache.cayenne.modeler.project.CayenneProject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CayenneProjectManager
{
private static final Log LOGGER = LogFactory.getLog(CayenneProjectManager.class);

private static List<CayenneProject> projects = new ArrayList<CayenneProject>();

public static CayenneProject projectForPath(final String path)
@@ -46,7 +50,7 @@ public static CayenneProject projectForPath(final String path)
catch (final MalformedURLException exception) // FIXME: Need to handle this better.
{
// TODO Auto-generated catch block
exception.printStackTrace();
LOGGER.error("Could not open project", exception);
}
}

@@ -21,11 +21,16 @@

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javafx.fxml.FXMLLoader;
import javafx.scene.layout.AnchorPane;

public abstract class AbstractViewLayout extends AnchorPane implements MainWindowSupport
{
private static final Log LOGGER = LogFactory.getLog(AbstractViewLayout.class);

private MainWindowLayout mainWindow;

protected AbstractViewLayout(MainWindowLayout mainWindow, String layout) throws IOException
@@ -41,7 +46,7 @@ protected AbstractViewLayout(MainWindowLayout mainWindow, String layout) throws

public void initialize()
{
System.out.println("init " + this.getClass().getCanonicalName());
LOGGER.info("init " + this.getClass().getCanonicalName());

loadSubViews();
}
@@ -28,6 +28,8 @@
import org.apache.cayenne.modeler.notification.event.DataDomainChangeEvent;
import org.apache.cayenne.modeler.notification.listener.DataDomainListener;
import org.apache.cayenne.modeler.project.CayenneProject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
@@ -42,6 +44,8 @@
implements DataDomainListener,
DetailEditorSupport<DataDomainAdapter>
{
private static final Log LOGGER = LogFactory.getLog(DataDomainLayout.class);

// private MainWindowLayout mainWindow;

private static Map<CayenneProject, BeanPathAdapter<CayenneProject>> dataDomainPropertyAdapterMap = new HashMap<CayenneProject, BeanPathAdapter<CayenneProject>>();
@@ -80,7 +84,7 @@ public DataDomainLayout(final MainWindowSupport parent) throws IOException
// }

private final ChangeListener<FieldPathValue> changeObserver = (observable, oldValue, newValue) ->
System.out.println("Observable: " + observable + ", oldValue: " + oldValue + ", newValue: " + newValue);
LOGGER.debug("Observable: " + observable + ", oldValue: " + oldValue + ", newValue: " + newValue);



@@ -93,7 +97,7 @@ public void setPropertyAdapter(final DataDomainAdapter dataDomainAdapter)
@Override
public void beginEditing()
{
System.out.println("begin editing " + this);
LOGGER.debug("begin editing " + this);

dataDomainNameTextField.textProperty().bindBidirectional(dataDomainAdapter.getDomainNameProperty());
objectValidationCheckBox.selectedProperty().bindBidirectional(dataDomainAdapter.getValidatingObjectsProperty());
@@ -103,7 +107,7 @@ public void beginEditing()

public void beginEditingNotCalled()
{
System.out.println("begin editing");
LOGGER.debug("begin editing");

dataDomainNameTextField.setText(getMainWindow().getCayenneProject().getDataDomainName());
dataDomainNameTextField.textProperty().addListener((observable, oldValue, newValue) ->
@@ -148,7 +152,7 @@ public void beginEditingNotCalled()
@Override
public void endEditing()
{
System.out.println("end editing " + this);
LOGGER.debug("end editing " + this);

dataDomainNameTextField.textProperty().unbindBidirectional(dataDomainAdapter.getDomainNameProperty());
objectValidationCheckBox.selectedProperty().unbindBidirectional(dataDomainAdapter.getValidatingObjectsProperty());
@@ -181,7 +185,7 @@ public void handleDataDomainChange(final DataDomainChangeEvent event)
{
if (event.getEventSource() != this)
{
System.out.println("Handling DD Change in DDLayout");
LOGGER.debug("Handling DD Change in DDLayout");

switch (event.getEventType())
{
@@ -22,6 +22,8 @@
import java.io.IOException;

import org.apache.cayenne.modeler.adapters.DataMapAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javafx.fxml.FXML;
import javafx.scene.control.TextField;
@@ -30,6 +32,8 @@
extends AbstractViewLayout
implements DetailEditorSupport<DataMapAdapter>
{
private static final Log LOGGER = LogFactory.getLog(DataMapLayout.class);

// private MainWindowLayout mainWindow;

@FXML
@@ -58,16 +62,15 @@ public void setPropertyAdapter(final DataMapAdapter dataMapAdapter)
@Override
public void beginEditing()
{
System.out.println("begin editing " + this);

LOGGER.debug("begin editing " + this);

dataMapName.textProperty().bindBidirectional(dataMapAdapter.getNameProperty());
}

@Override
public void endEditing()
{
System.out.println("end editing " + this);
LOGGER.debug("end editing " + this);

dataMapName.textProperty().unbindBidirectional(dataMapAdapter.getNameProperty());
}
@@ -25,6 +25,8 @@
import org.apache.cayenne.map.DbEntity;
import org.apache.cayenne.modeler.adapters.DatabaseEntityAdapter;
import org.apache.cayenne.modeler.utility.ObjectEntityUtilities;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import de.jensd.fx.glyphs.GlyphsDude;
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon;
@@ -39,6 +41,8 @@
implements DetailEditorSupport<DatabaseEntityAdapter>

{
private static final Log LOGGER = LogFactory.getLog(DatabaseEntityColumnsTabLayout.class);

// @FXML
// private TableView<ObjAttribute> attributesTableView;
//
@@ -138,7 +142,7 @@ protected void loadSubViews()
catch (Exception exception)
{
// TODO Auto-generated catch block
exception.printStackTrace();
// exception.printStackTrace();
}
}

@@ -159,7 +163,7 @@ protected void loadSubViews()
@Deprecated // Unused?
public void display(DbEntity dbEntity)
{
System.out.println("trying to display: " + dbEntity);
LOGGER.debug("trying to display: " + dbEntity);
// attributesTableView.setItems(FXCollections.observableArrayList(objEntity.getAttributes()));
// objectEntityClassTabViewController.display(objEntity);
// objEntity.getAttributes()
@@ -168,7 +172,7 @@ public void display(DbEntity dbEntity)
// public void tabChanged(ActionEvent event)
public void tabChanged(Event event)
{
System.out.println(event);
LOGGER.debug("event: " + event);
getMainWindow().getCayenneProject().getDataMaps();
}

@@ -23,6 +23,8 @@

import org.apache.cayenne.map.DbEntity;
import org.apache.cayenne.modeler.adapters.DatabaseEntityAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javafx.event.Event;
import javafx.fxml.FXML;
@@ -32,6 +34,8 @@
extends AbstractViewLayout
implements DetailEditorSupport<DatabaseEntityAdapter>
{
private static final Log LOGGER = LogFactory.getLog(DatabaseEntityLayout.class);

@FXML
private AnchorPane tableTabAnchorPane, columnsTabAnchorPane;

@@ -77,7 +81,7 @@ protected void loadSubViews()
catch (Exception exception)
{
// TODO Auto-generated catch block
exception.printStackTrace();
LOGGER.error("Could not load subviews", exception);
}
}

@@ -97,7 +101,7 @@ protected void loadSubViews()
@Deprecated // Unused?
public void display(DbEntity dbEntity)
{
System.out.println("trying to display: " + dbEntity);
LOGGER.debug("trying to display: " + dbEntity);
// objectEntityClassTabLayout.display(dbEntity);
// objectEntityAttributesTabLayout.display(dbEntity);
// objEntity.getAttributes()
@@ -106,7 +110,7 @@ public void display(DbEntity dbEntity)
// public void tabChanged(ActionEvent event)
public void tabChanged(Event event)
{
System.out.println(event);
LOGGER.debug("event: " + event);
getMainWindow().getCayenneProject().getDataMaps();
}

0 comments on commit e507b8d

Please sign in to comment.