Skip to content

Commit

Permalink
#10 Provided Implementation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serjiokov committed Apr 21, 2020
1 parent 69db099 commit b5a081d
Show file tree
Hide file tree
Showing 35 changed files with 874 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface ConteinerProvider<I> {
*
* @return provider {@link SectionContentProvider}
*/
SectionContentProvider getSectionContentProvider();
SectionContentProvider<I> getSectionContentProvider();

/**
* The method designed to provide {@link GroupContentProvider} provider
Expand Down
7 changes: 7 additions & 0 deletions bundles/org.eclipse.chronograph.base/.classpath
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>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.chronograph.api.test</name>
<name>org.eclipse.chronograph.base</name>
<comment></comment>
<projects>
</projects>
Expand Down
12 changes: 12 additions & 0 deletions bundles/org.eclipse.chronograph.base/META-INF/MANIFEST.MF
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
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\




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\




17 changes: 17 additions & 0 deletions bundles/org.eclipse.chronograph.base/build.properties
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/
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;
}
}
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;
}

}
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();
}

}
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;
}

}
Loading

0 comments on commit b5a081d

Please sign in to comment.