Skip to content

Commit

Permalink
Last minute JavaDoc enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
shai-almog committed Jan 21, 2016
1 parent 84f07f1 commit d4536a8
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 9 deletions.
38 changes: 38 additions & 0 deletions CodenameOne/JavaDocOverview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Codename One API</title>
</head>
<body>
<h2>Codename One - Write Once Run Anywhere Native Mobile Apps Using Java</h2>
<p><a href="https://www.codenameone.com/">Codename One</a> allows Java developers to write
their app once and have it work on all mobile devices (iOS, Android etc.). It features a simulator,
designer (visual theme/builder) and ports to multiple OS's.</p>

<p>Codename One is a mature open source project and its roots go back to Sun Microsystems (2006)
where one of its core underlying components was developed and open sourced.</p>


<p>
<a href="https://github.com/codenameone/CodenameOne/">Codename One is open source</a>.
This includes the libraries, native OS ports, resource editor &amp; native
VM code. It also includes themes and separate related projects containing demos, skins etc.
</p>

<p>
You can understand more about how Codename One works and how the API fits into everything in
<a href="http://stackoverflow.com/a/10646336/756809" target="_blank">this stackoverflow answer</a>.
</p>
<h4>Other Resources</h4>
<ul>
<li><a href="https://www.codenameone.com/manual/">Developer Guide</a></li>
<li><a href="https://www.codenameone.com/how-do-i.html">How Do I? - Get quick video answers and short tutorials for common questions</a></li>
<li><a href="https://www.codenameone.com/blog.html">The Codename One Blog</a></li>
<li><a href="https://www.codenameone.com/cn1libs.html">cn1libs are extensions to Codename One that allow using device native functionality</a></li>
<li><a href="http://stackoverflow.com/tags/codenameone">Stack Overflow's Codename One Tag</a></li>
<li><a href="https://www.codenameone.com/discussion-forum.html">Community Discussion Forum</a></li>
<li><a href="https://github.com/codenameone/CodenameOne/issues/">The Open Source project on github</a></li>
<li><a href="https://www.codenameone.com/blog/how-to-use-the-codename-one-sources.html">Build Codename One from source code</a></li>
</ul>
</body>
</html>
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ads/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<p>
The Ads API allows developers to add Ads to their apps
A legacy banner Ads API. This has been replaced by more modern approaches mainly thru <a href="https://www.codenameone.com/cn1libs.html">cn1libs</a>.
</p>
<p>
Currently inner-active ads Network is supported
Expand Down
1 change: 1 addition & 0 deletions CodenameOne/src/com/codename1/capture/Capture.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class Capture {

/**
* Returns true if the device has camera false otherwise.
* @return true if the device has a camera
*/
public static boolean hasCamera(){
return Display.getInstance().hasCamera();
Expand Down
25 changes: 20 additions & 5 deletions CodenameOne/src/com/codename1/charts/ChartComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ public void paint(Graphics g) {

/**
* Converts screen coordinates to chart coordinates.
* @param x
* @param y
* @param x screen x position
* @param y screen y position
* @return The chart coordinate corresponding to the given screen coordinate.
*/
public Point screenToChartCoord(int x, int y){
Expand All @@ -199,8 +199,13 @@ public Point screenToChartCoord(int x, int y){
return new Point(x-getAbsoluteX(), y-getAbsoluteY());
}



/**
* Returns the screen position from a chart coordinate
*
* @param x the x position within the chart
* @param y the y position within the chart
* @return a position within the screen
*/
public Point chartToScreenCoord(int x, int y){
x += getAbsoluteX();
y += getAbsoluteY();
Expand All @@ -213,6 +218,11 @@ public Point chartToScreenCoord(int x, int y){
return new Point(x, y);
}

/**
* Converts a chart coordinate spaced shape to the same shape in the screen coordinate space
* @param s shape in screen coordinates
* @return same shape using chart space coordinates
*/
public Shape screenToChartShape(Shape s){
GeneralPath p = new GeneralPath();
Transform t = Transform.makeIdentity();
Expand All @@ -223,7 +233,12 @@ public Shape screenToChartShape(Shape s){
p.append(s.getPathIterator(t), false);
return p;
}


/**
* Converts a screen coordinate spaced shape to the same shape in the chart coordinate space
* @param s shape in chart coordinates
* @return same shape using screen coordinate space
*/
public Shape chartToScreenShape(Shape s){
GeneralPath p = new GeneralPath();
Transform inverse = Transform.makeTranslation(getAbsoluteX(), getAbsoluteY());
Expand Down
10 changes: 10 additions & 0 deletions CodenameOne/src/com/codename1/charts/ChartUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
*/
public class ChartUtil {
private Canvas c = new Canvas();

/**
* Draws the given chart onto the given graphics
*
* @param g the graphics object
* @param chart the chart object
* @param bounds the bounds in which the chart should be drawn within the graphics
* @param absX
* @param absY
*/
public void paintChart(Graphics g, AbstractChart chart, Rectangle bounds, int absX, int absY){
c.g = g;
c.bounds = bounds;
Expand Down
6 changes: 6 additions & 0 deletions CodenameOne/src/com/codename1/charts/compat/package.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<title>Compat</title>
<body>
This package contains compatibility classes for internal use
</body>
</html>
7 changes: 6 additions & 1 deletion CodenameOne/src/com/codename1/system/NativeInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@

/**
* This is a marker interface that should be extended by a user interface in order
* to indicate that said interface is implemented in native code.
* to indicate that said interface is implemented in native code. To understand more
* about native interfaces you can check out this
* <a href="https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html">
* quick "How Do I?" tutorial</a>.<br />
* Alternatively you can dig deeper into <a href="https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-1.html">
* this tutorial for integrating 3rd party native libraries</a>.
*
* @author Shai Almog
*/
Expand Down
6 changes: 6 additions & 0 deletions CodenameOne/src/com/codename1/system/NativeLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
/**
* Creates an instance of the native interface which will call the underlying
* platform using the convention documented in the package docs.
* To understand more
* about native interfaces you can check out this
* <a href="https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html">
* quick "How Do I?" tutorial</a>.<br />
* Alternatively you can dig deeper into <a href="https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-1.html">
* this tutorial for integrating 3rd party native libraries</a>.
*
* @author Shai Almog
*/
Expand Down
6 changes: 4 additions & 2 deletions CodenameOne/src/com/codename1/system/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
</head>
<body>
<p>
Low level calls into the Codename One system, including support for making platform native API calls. Notice
Low level calls into the Codename One system, including
<a href="https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html">
support for making platform native API calls</a>. Notice
that when we say "native" we do not mean C/C++ always but rather the platforms "native" environment. So in the
case of J2ME the Java code will be invoked with full access to the J2ME API's, in case of iOS an Objective-C
case of Android the Java code will be invoked with full access to the Android API's, in case of iOS an Objective-C
message would be sent and so forth.
</p>
<p>
Expand Down

0 comments on commit d4536a8

Please sign in to comment.