Skip to content

Commit

Permalink
v4.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
touchmii committed Jan 11, 2021
1 parent b39902c commit c471084
Show file tree
Hide file tree
Showing 17 changed files with 1,103 additions and 215 deletions.
4 changes: 4 additions & 0 deletions gradle/java-artifacts.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
artifacts {
archives jar
archives sourcesJar
}
16 changes: 16 additions & 0 deletions gradle/java-codequality.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//apply plugin: 'checkstyle'
//
//checkstyle {
// toolVersion = '8.16'
// configFile = rootProject.file("config/checkstyle/checkstyle.xml")
// configProperties = [suppressions_file:rootDir.absolutePath + "/config/checkstyle/suppressions.xml"]
// showViolations = false
//}
//
//project.afterEvaluate { project ->
// project.tasks.withType(Checkstyle) {
// reports {
// html.stylesheet resources.text.fromFile(rootProject.file("config/checkstyle/checkstyle-noframes-severity-sorted.xsl"))
// }
// }
//}
64 changes: 64 additions & 0 deletions gradle/java-project.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apply plugin: 'java'

sourceCompatibility = '1.8'
archivesBaseName = name.toLowerCase()

repositories {
jcenter()
}

dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21', classifier: 'javadoc'

compileOnly group: 'javax.inject', name: 'javax.inject', version: '1'

compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
testCompileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'

// For JUnit 4.x tests
testCompileOnly group: 'junit', name: 'junit', version: '4.12'
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.3.2'
// For JUnit 5 tests
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.3.2'
testCompileOnly group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.2', classifier: 'javadoc'
testCompileOnly group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.3.2', classifier: 'javadoc'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.2'

testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompileOnly group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3', classifier: 'sources'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompileOnly group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3', classifier: 'sources'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.8.47'
testCompileOnly group: 'org.mockito', name: 'mockito-core', version: '2.8.47', classifier: 'sources'

testRuntime group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.21'
}

compileJava {
options.compilerArgs << "-Xlint:all"
options.compilerArgs << "-Xlint:-serial"
}

compileTestJava {
options.compilerArgs << "-Xlint:all"
options.compilerArgs << "-Xlint:-serial"
}

task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
classifier = 'sources'
from sourceSets.main.allSource
}

test {
ignoreFailures = true
systemProperties.put("java.awt.headless", "true")
}

ext {
// Attributes for the AsciiDoc documentation to include code from source files
javaSrcDir = sourceSets.main.java.srcDirs[0]
javaClassesDir = sourceSets.main.output.classesDirs
testSrcDir = sourceSets.test.java.srcDirs[0]
}
9 changes: 9 additions & 0 deletions gradle/maven-publishing.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apply plugin: 'maven'

configure(install.repositories.mavenInstaller) {
pom.project {
groupId = project.group
artifactId = project.name.toLowerCase()
version = project.version
}
}
16 changes: 0 additions & 16 deletions gradle/versioning.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) The openTCS Authors.
*
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
*/
package org.opentcs.components.plantoverview;

import java.util.Set;

/**
* Implementations of this class provide suggestions for transport order types.
*
* @author Martin Grzenia (Fraunhofer IML)
*/
public interface OrderTypeSuggestions {

/**
* Returns a set of types that can be assigned to a transport order.
*
* @return A set of types that can be assigned to a transport order.
*/
Set<String> getTypeSuggestions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) The openTCS Authors.
*
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
*/
package org.opentcs.configuration.cfg4j;

import org.cfg4j.source.ConfigurationSource;

/**
*
* @author Martin Grzenia (Fraunhofer IML)
* @author Stefan Walter (Fraunhofer IML)
*/
public interface SupplementaryConfigurationSource
extends ConfigurationSource {

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright (c) The openTCS Authors.
*
* <p>
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
Expand All @@ -13,6 +13,7 @@
import java.util.EventObject;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;
Expand All @@ -23,117 +24,116 @@
* A cell editor for maintaining different editors in one column.
* @author Philipp Seifert (Fraunhofer IML)
*/
final class SingleCellEditor
implements TableCellEditor {
final class SingleCellEditor implements TableCellEditor {

/**
* The TableCellEditors for every cell.
*/
private final Map<Integer, TableCellEditor> editors;
/**
* The current editor.
*/
private TableCellEditor editor;
/**
* The default editor.
*/
private final TableCellEditor defaultEditor;
/**
* The table associated with the editors.
*/
private final JTable table;
/**
* The TableCellEditors for every cell.
*/
private final Map<Integer, TableCellEditor> editors;
/**
* The current editor.
*/
private TableCellEditor editor;
/**
* The default editor.
*/
private final TableCellEditor defaultEditor;
/**
* The table associated with the editors.
*/
private final JTable table;
private final ResourceBundle BUNDLE = ResourceBundle.getBundle("org/opentcs/kernel/controlcenter/vehicles/Bundle");

/**
* Constructs a SingleCellEditor.
*
* @param table The JTable associated
*/
public SingleCellEditor(JTable table) {
this.table = table;
editors = new HashMap<>();
defaultEditor = new DefaultCellEditor(new JTextField());
}

/**
* Assigns an editor to a row.
*
* @param row table row
* @param rowEditor table cell editor
*/
public void setEditorAt(int row, TableCellEditor rowEditor) {
editors.put(new Integer(row), rowEditor);
}

@Override
public Component getTableCellEditorComponent(JTable whichTable,
Object value,
boolean isSelected,
int row,
int column) {
return editor.getTableCellEditorComponent(whichTable,
value,
isSelected,
row,
column);
}
/**
* Constructs a SingleCellEditor.
*
* @param table The JTable associated
*/
public SingleCellEditor(JTable table) {
this.table = table;
editors = new HashMap<>();
defaultEditor = new DefaultCellEditor(new JTextField());
}

@Override
public Object getCellEditorValue() {
return editor.getCellEditorValue();
}
/**
* Assigns an editor to a row.
*
* @param row table row
* @param rowEditor table cell editor
*/
public void setEditorAt(int row, TableCellEditor rowEditor) {
editors.put(new Integer(row), rowEditor);
}

@Override
public boolean stopCellEditing() {
return editor.stopCellEditing();
}
@Override
public Component getTableCellEditorComponent(JTable whichTable,
Object value,
boolean isSelected,
int row,
int column) {
return editor.getTableCellEditorComponent(whichTable,
value,
isSelected,
row,
column);
}

@Override
public void cancelCellEditing() {
editor.cancelCellEditing();
}
@Override
public Object getCellEditorValue() {
return editor.getCellEditorValue();
}

@Override
public boolean isCellEditable(EventObject anEvent) {
if (anEvent instanceof KeyEvent) {
return false;
@Override
public boolean stopCellEditing() {
return editor.stopCellEditing();
}
selectEditor((MouseEvent) anEvent);
return editor.isCellEditable(anEvent);
}

@Override
public void addCellEditorListener(CellEditorListener l) {
editor.addCellEditorListener(l);
}
@Override
public void cancelCellEditing() {
editor.cancelCellEditing();
}

@Override
public void removeCellEditorListener(CellEditorListener l) {
editor.removeCellEditorListener(l);
}
@Override
public boolean isCellEditable(EventObject anEvent) {
if (anEvent instanceof KeyEvent) {
return false;
}
selectEditor((MouseEvent) anEvent);
return editor.isCellEditable(anEvent);
}

@Override
public boolean shouldSelectCell(EventObject anEvent) {
selectEditor((MouseEvent) anEvent);
return editor.shouldSelectCell(anEvent);
}
@Override
public void addCellEditorListener(CellEditorListener l) {
editor.addCellEditorListener(l);
}

/**
* Sets the current editor.
*
* @param e A MouseEvent
*/
public void selectEditor(MouseEvent e) {
int row;
if (e == null) {
row = table.getSelectionModel().getAnchorSelectionIndex();
@Override
public void removeCellEditorListener(CellEditorListener l) {
editor.removeCellEditorListener(l);
}
else {
row = table.rowAtPoint(e.getPoint());

@Override
public boolean shouldSelectCell(EventObject anEvent) {
selectEditor((MouseEvent) anEvent);
return editor.shouldSelectCell(anEvent);
}
editor = editors.get(new Integer(row));
if (editor == null) {
editor = defaultEditor;

/**
* Sets the current editor.
*
* @param e A MouseEvent
*/
public void selectEditor(MouseEvent e) {
int row;
if (e == null) {
row = table.getSelectionModel().getAnchorSelectionIndex();
} else {
row = table.rowAtPoint(e.getPoint());
}
editor = editors.get(new Integer(row));
if (editor == null) {
editor = defaultEditor;
}
table.changeSelection(row, table.getColumn(BUNDLE.getString("Adapter")).getModelIndex(), false, false);
}
table.changeSelection(row, table.getColumn("Adapter").getModelIndex(), false, false);
}
}
Loading

0 comments on commit c471084

Please sign in to comment.