-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#10 Provided Implementation and tests
- Loading branch information
Showing
35 changed files
with
874 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
2 changes: 1 addition & 1 deletion
2
...org.eclipse.chronograph.api.test/.project → ...les/org.eclipse.chronograph.base/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Version: 0.1.0.qualifier | ||
Bundle-Name: %Bundle-Name | ||
Bundle-Vendor: %Bundle-Vendor | ||
Bundle-Copyright: %Bundle-Copyright | ||
Bundle-SymbolicName: org.eclipse.chronograph.base | ||
Automatic-Module-Name: org.eclipse.chronometer.core | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: org.eclipse.chronograph.api | ||
Export-Package: org.eclipse.chronograph.internal.base, | ||
org.eclipse.chronograph.internal.providers |
27 changes: 27 additions & 0 deletions
27
bundles/org.eclipse.chronograph.base/OSGI-INF/OSGI-INF/l10n/bundle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
############################################################################### | ||
# Copyright (c) 2020 ArSysOp | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Sergei Kovalchuk <[email protected]> - initial API and implementation | ||
############################################################################### | ||
|
||
Bundle-Name = Eclipse Chronograph Core | ||
Bundle-Vendor = Eclipse | ||
Bundle-Copyright = Copyright (c) 2020 ArSysOp and others.\n\ | ||
\n\ | ||
This program and the accompanying materials are made\n\ | ||
available under the terms of the Eclipse Public License 2.0\n\ | ||
which is available at https://www.eclipse.org/legal/epl-2.0/\n\ | ||
\n\ | ||
SPDX-License-Identifier: EPL-2.0\n\ | ||
|
||
|
||
|
||
|
27 changes: 27 additions & 0 deletions
27
bundles/org.eclipse.chronograph.base/OSGI-INF/l10n/bundle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
############################################################################### | ||
# Copyright (c) 2020 ArSysOp | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Sergei Kovalchuk <[email protected]> - initial API and implementation | ||
############################################################################### | ||
|
||
Bundle-Name = Eclipse Chronograph Core | ||
Bundle-Vendor = Eclipse | ||
Bundle-Copyright = Copyright (c) 2020 ArSysOp and others.\n\ | ||
\n\ | ||
This program and the accompanying materials are made\n\ | ||
available under the terms of the Eclipse Public License 2.0\n\ | ||
which is available at https://www.eclipse.org/legal/epl-2.0/\n\ | ||
\n\ | ||
SPDX-License-Identifier: EPL-2.0\n\ | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
############################################################################### | ||
# Copyright (c) 2020 ArSysOp and others | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Sergei Kovalchuk <[email protected]> - initial API and implementation | ||
############################################################################### | ||
source.. = src/ | ||
output.. = target/classes/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/ |
64 changes: 64 additions & 0 deletions
64
bundles/org.eclipse.chronograph.base/src/org/eclipse/chronograph/internal/base/AreaImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp and Others | ||
* | ||
* 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Sergei Kovalchuk<[email protected]> - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chronograph.internal.base; | ||
|
||
import org.eclipse.chronograph.internal.api.Area; | ||
|
||
/** | ||
* | ||
* Implementation of {@link Area} interface intended to store graphical | ||
* object location | ||
*/ | ||
public class AreaImpl implements Area { | ||
|
||
private int x = 0; | ||
private int y = 0; | ||
private int width; | ||
private int height; | ||
|
||
public AreaImpl(int x, int y, int width, int height) { | ||
super(); | ||
this.x = x; | ||
this.y = y; | ||
this.width = width; | ||
this.height = height; | ||
} | ||
|
||
@Override | ||
public int width() { | ||
return width; | ||
} | ||
|
||
@Override | ||
public int height() { | ||
return height; | ||
} | ||
|
||
@Override | ||
public int x() { | ||
return x; | ||
} | ||
|
||
@Override | ||
public int y() { | ||
return y; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...les/org.eclipse.chronograph.base/src/org/eclipse/chronograph/internal/base/BrickImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Sergei Kovalchuk <[email protected]> - | ||
* initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chronograph.internal.base; | ||
|
||
import org.eclipse.chronograph.internal.api.Brick; | ||
import org.eclipse.chronograph.internal.api.BrickContainer; | ||
import org.eclipse.chronograph.internal.api.Position; | ||
|
||
public class BrickImpl implements Brick { | ||
|
||
//public static final int DRAWING_ITEM_HEIGHT = 20; | ||
private String id; | ||
private Position position; | ||
private BrickContainer parent; | ||
|
||
public BrickImpl(BrickContainer parent, String id, int start, int end) { | ||
this.id = id; | ||
this.parent = parent; | ||
this.position = new PositionImpl(start, end); | ||
} | ||
|
||
public String id() { | ||
return this.id; | ||
} | ||
|
||
@Override | ||
public BrickContainer container() { | ||
return parent; | ||
} | ||
|
||
@Override | ||
public Position position() { | ||
return position; | ||
} | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
...les/org.eclipse.chronograph.base/src/org/eclipse/chronograph/internal/base/GroupImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Sergei Kovalchuk <[email protected]> - | ||
* initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chronograph.internal.base; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.eclipse.chronograph.internal.api.Brick; | ||
import org.eclipse.chronograph.internal.api.Group; | ||
import org.eclipse.chronograph.internal.api.GroupContainer; | ||
|
||
/** | ||
* | ||
* Implementation of {@link Group} interface | ||
* | ||
*/ | ||
public class GroupImpl implements Group { | ||
|
||
private String id; | ||
private GroupContainer parent; | ||
private List<Brick> bricks = new ArrayList<Brick>(); | ||
|
||
public GroupImpl(String id, GroupContainer parent) { | ||
this.id = id; | ||
this.parent = parent; | ||
} | ||
|
||
public GroupImpl(String id, List<Brick> bricks) { | ||
this.id = id; | ||
this.bricks = bricks; | ||
} | ||
|
||
public GroupImpl(String id, GroupContainer parent, List<Brick> bricks) { | ||
this.id = id; | ||
this.parent = parent; | ||
this.bricks = bricks; | ||
} | ||
|
||
public String id() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public List<? extends Brick> bricks() { | ||
return bricks; | ||
} | ||
|
||
@Override | ||
public GroupContainer container() { | ||
return parent; | ||
} | ||
|
||
@Override | ||
public List<? extends Group> groups() { | ||
return parent.groups(); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
.../org.eclipse.chronograph.base/src/org/eclipse/chronograph/internal/base/PositionImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Sergei Kovalchuk <[email protected]> - | ||
* initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.chronograph.internal.base; | ||
|
||
import org.eclipse.chronograph.internal.api.Position; | ||
|
||
/** | ||
* | ||
* Implementation of {@link Position} interface intended to store period of time | ||
* | ||
*/ | ||
public class PositionImpl implements Position { | ||
private long start; | ||
private long end; | ||
|
||
public PositionImpl(long start, long end) { | ||
this.start = start; | ||
this.end = end; | ||
} | ||
|
||
@Override | ||
public long start() { | ||
return start; | ||
} | ||
|
||
@Override | ||
public long end() { | ||
return end; | ||
} | ||
|
||
@Override | ||
public long duration() { | ||
return end - start; | ||
} | ||
|
||
} |
Oops, something went wrong.