Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change formatter plugin to @diffplug's Spotless plugin (Attempt 2) #214

Merged
merged 8 commits into from
Jul 26, 2018
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Auto detect text files and perform LF normalization
* text=auto

# Known text files
*.java text
*.xml text
*.yml text
*.md text
*.sh text
*.txt text

# Known binary files
*.jar binary
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package edu.uci.ics.jung.layout.util;
/**
* interface for support for LayoutEvents
*
* @param <N>
*/
public interface LayoutChangeListener<N> {
void layoutChanged(LayoutEvent<N> evt);
void layoutChanged(LayoutNetworkEvent<N> evt);
}
package edu.uci.ics.jung.layout.util;

/**
* interface for support for LayoutEvents
*
* @param <N>
*/
public interface LayoutChangeListener<N> {

void layoutChanged(LayoutEvent<N> evt);

void layoutChanged(LayoutNetworkEvent<N> evt);
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package edu.uci.ics.jung.layout.util;
import edu.uci.ics.jung.layout.model.Point;
/**
* an event with information about a node and its (new?) location
*
* @author Tom Nelson
* @param <N>
*/
public class LayoutEvent<N> {
final N node;
final Point location;
public LayoutEvent(N node, Point location) {
this.node = node;
this.location = location;
}
public N getNode() {
return node;
}
public Point getLocation() {
return location;
}
}
package edu.uci.ics.jung.layout.util;

import edu.uci.ics.jung.layout.model.Point;

/**
* an event with information about a node and its (new?) location
*
* @author Tom Nelson
* @param <N>
*/
public class LayoutEvent<N> {

final N node;
final Point location;

public LayoutEvent(N node, Point location) {
this.node = node;
this.location = location;
}

public N getNode() {
return node;
}

public Point getLocation() {
return location;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package edu.uci.ics.jung.layout.util;
/**
* interface for support to LayoutChangeListeners
*
* @param <N>
*/
public interface LayoutEventSupport<N> {
void addLayoutChangeListener(LayoutChangeListener<N> listener);
void removeLayoutChangeListener(LayoutChangeListener<N> listener);
}
package edu.uci.ics.jung.layout.util;

/**
* interface for support to LayoutChangeListeners
*
* @param <N>
*/
public interface LayoutEventSupport<N> {

void addLayoutChangeListener(LayoutChangeListener<N> listener);

void removeLayoutChangeListener(LayoutChangeListener<N> listener);
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package edu.uci.ics.jung.layout.util;
import com.google.common.graph.Graph;
import edu.uci.ics.jung.layout.model.Point;
/**
* A LayoutEvent that also includes a reference to the Graph
*
* @param <N>
*/
public class LayoutGraphEvent<N> extends LayoutEvent<N> {
final Graph<N> graph;
public LayoutGraphEvent(N node, Graph<N> graph, Point location) {
super(node, location);
this.graph = graph;
}
public LayoutGraphEvent(LayoutEvent<N> layoutEvent, Graph<N> graph) {
super(layoutEvent.getNode(), layoutEvent.location);
this.graph = graph;
}
public Graph<N> getGraph() {
return graph;
}
}
package edu.uci.ics.jung.layout.util;

import com.google.common.graph.Graph;
import edu.uci.ics.jung.layout.model.Point;

/**
* A LayoutEvent that also includes a reference to the Graph
*
* @param <N>
*/
public class LayoutGraphEvent<N> extends LayoutEvent<N> {

final Graph<N> graph;

public LayoutGraphEvent(N node, Graph<N> graph, Point location) {
super(node, location);
this.graph = graph;
}

public LayoutGraphEvent(LayoutEvent<N> layoutEvent, Graph<N> graph) {
super(layoutEvent.getNode(), layoutEvent.location);
this.graph = graph;
}

public Graph<N> getGraph() {
return graph;
}
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package edu.uci.ics.jung.layout.util;
import com.google.common.graph.Network;
import edu.uci.ics.jung.layout.model.Point;
/**
* An LayoutEvent that also includes a reference to the Network
*
* @author Tom Nelson
* @param <N>
*/
public class LayoutNetworkEvent<N> extends LayoutEvent<N> {
final Network<N, ?> network;
public LayoutNetworkEvent(N node, Network<N, ?> network, Point location) {
super(node, location);
this.network = network;
}
public LayoutNetworkEvent(LayoutEvent<N> layoutEvent, Network<N, ?> network) {
super(layoutEvent.getNode(), layoutEvent.location);
this.network = network;
}
public Network<N, ?> getNetwork() {
return this.network;
}
}
package edu.uci.ics.jung.layout.util;

import com.google.common.graph.Network;
import edu.uci.ics.jung.layout.model.Point;

/**
* An LayoutEvent that also includes a reference to the Network
*
* @author Tom Nelson
* @param <N>
*/
public class LayoutNetworkEvent<N> extends LayoutEvent<N> {

final Network<N, ?> network;

public LayoutNetworkEvent(N node, Network<N, ?> network, Point location) {
super(node, location);
this.network = network;
}

public LayoutNetworkEvent(LayoutEvent<N> layoutEvent, Network<N, ?> network) {
super(layoutEvent.getNode(), layoutEvent.location);
this.network = network;
}

public Network<N, ?> getNetwork() {
return this.network;
}
}
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
/*
* Copyright (c) 2008, The JUNG Authors
*
* All rights reserved.
*
* This software is open-source under the BSD license; see either
* "license.txt" or
* https://github.com/jrtom/jung/blob/master/LICENSE for a description.
*/
package edu.uci.ics.jung.io.graphml;
import edu.uci.ics.jung.io.GraphIOException;
import javax.xml.stream.XMLStreamException;
/**
* Converts an exception to the a GraphIOException. Runtime exceptions are checked for the cause. If
* the cause is an XMLStreamException, it is converted to a GraphIOException. Otherwise, the
* RuntimeException is rethrown.
*
* @author Nathan Mittler - [email protected]
*/
public class ExceptionConverter {
/**
* Converts an exception to the a GraphIOException. Runtime exceptions are checked for the cause.
* If the cause is an XMLStreamException, it is converted to a GraphReaderException. Otherwise,
* the RuntimeException is rethrown.
*
* @param e the exception to be converted
* @throws GraphIOException the converted exception
*/
public static void convert(Exception e) throws GraphIOException {
if (e instanceof GraphIOException) {
throw (GraphIOException) e;
}
if (e instanceof RuntimeException) {
// If the cause was an XMLStreamException, throw a GraphReaderException
if (e.getCause() instanceof XMLStreamException) {
throw new GraphIOException(e.getCause());
}
throw (RuntimeException) e;
}
throw new GraphIOException(e);
}
}
/*
* Copyright (c) 2008, The JUNG Authors
*
* All rights reserved.
*
* This software is open-source under the BSD license; see either
* "license.txt" or
* https://github.com/jrtom/jung/blob/master/LICENSE for a description.
*/

package edu.uci.ics.jung.io.graphml;

import edu.uci.ics.jung.io.GraphIOException;
import javax.xml.stream.XMLStreamException;

/**
* Converts an exception to the a GraphIOException. Runtime exceptions are checked for the cause. If
* the cause is an XMLStreamException, it is converted to a GraphIOException. Otherwise, the
* RuntimeException is rethrown.
*
* @author Nathan Mittler - [email protected]
*/
public class ExceptionConverter {

/**
* Converts an exception to the a GraphIOException. Runtime exceptions are checked for the cause.
* If the cause is an XMLStreamException, it is converted to a GraphReaderException. Otherwise,
* the RuntimeException is rethrown.
*
* @param e the exception to be converted
* @throws GraphIOException the converted exception
*/
public static void convert(Exception e) throws GraphIOException {

if (e instanceof GraphIOException) {
throw (GraphIOException) e;
}

if (e instanceof RuntimeException) {

// If the cause was an XMLStreamException, throw a GraphReaderException
if (e.getCause() instanceof XMLStreamException) {
throw new GraphIOException(e.getCause());
}

throw (RuntimeException) e;
}

throw new GraphIOException(e);
}
}
Loading