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

move swing related stuff out of runtime package into org.antlr.v4.gui #955

Merged
merged 3 commits into from
Jul 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 7 additions & 31 deletions runtime/Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
<name>ANTLR 4 Runtime</name>
<description>The ANTLR 4 Runtime</description>

<dependencies>
<dependency>
<groupId>org.abego.treelayout</groupId>
<artifactId>org.abego.treelayout.core</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
Expand All @@ -38,15 +30,15 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.4</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<configuration>
<configuration>
<instructions>
<Bundle-SymbolicName>org.antlr.antlr4-runtime-osgi</Bundle-SymbolicName>
<Implementation-Title>ANTLR 4 Runtime</Implementation-Title>
Expand All @@ -55,37 +47,21 @@
<Implementation-Version>${project.version}</Implementation-Version>
</instructions>
</configuration>
<goals>
<goals>
<goal>manifest</goal>
</goals>
</goals>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
</configuration>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
44 changes: 0 additions & 44 deletions runtime/Java/src/org/antlr/v4/runtime/RuleContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
import org.antlr.v4.runtime.tree.RuleNode;
import org.antlr.v4.runtime.tree.Trees;
import org.antlr.v4.runtime.tree.gui.TreeViewer;

import javax.print.PrintException;
import javax.swing.*;
Expand Down Expand Up @@ -183,49 +182,6 @@ public int getChildCount() {
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { return visitor.visitChildren(this); }

/** Call this method to view a parse tree in a dialog box visually. */
public Future<JDialog> inspect(Parser parser) {
List<String> ruleNames = parser != null ? Arrays.asList(parser.getRuleNames()) : null;
return inspect(ruleNames);
}

public Future<JDialog> inspect(List<String> ruleNames) {
TreeViewer viewer = new TreeViewer(ruleNames, this);
return viewer.open();
}

/** Save this tree in a postscript file */
public void save(Parser parser, String fileName)
throws IOException, PrintException
{
List<String> ruleNames = parser != null ? Arrays.asList(parser.getRuleNames()) : null;
save(ruleNames, fileName);
}

/** Save this tree in a postscript file using a particular font name and size */
public void save(Parser parser, String fileName,
String fontName, int fontSize)
throws IOException
{
List<String> ruleNames = parser != null ? Arrays.asList(parser.getRuleNames()) : null;
save(ruleNames, fileName, fontName, fontSize);
}

/** Save this tree in a postscript file */
public void save(List<String> ruleNames, String fileName)
throws IOException, PrintException
{
Trees.writePS(this, ruleNames, fileName);
}

/** Save this tree in a postscript file using a particular font name and size */
public void save(List<String> ruleNames, String fileName,
String fontName, int fontSize)
throws IOException
{
Trees.writePS(this, ruleNames, fileName, fontName, fontSize);
}

/** Print out a whole tree, not just a node, in LISP format
* (root child1 .. childN). Print just a node if this is a leaf.
* We have to know the recognizer so we can get rule names.
Expand Down
Loading