Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
javalover53
Posts: 59
Registered: ‎01-02-2009
My Device: Not Specified

Java Graphics how many people are on the bus without me?

[ Edited ]

Question: Where can I find the source code to the Graphics Class including the "unknown" native functions which are hidden & top secret?

 

 

I would like to see the code so that I might learn from it. I had no idea knowledge was such a hidden thing or why it's so top secret....if any of you know of some other languages source code i'd also like to look at that...just the simple function that draws the bits to the screen. Even if it's in Assembler i'd also like to see this as well.

 

 

At some point in time someone typed something on a screen or punched it into a card & I just want to see that work so I can learn from it.... It would be a great help to me, just to see what's happening in the background, as of right now i'm just in the dark banging my head against a wall going "fine I guess i'll never find the answer"

 

 

*Sigh*   the following is basically just a rant of mine & what i'm dealing with regaurding finding the source code for the Graphics class.

 

 

 

We have come so far in this world today, it seems like google can answer all questions including how we might end up curing cancer...I can watch videos on google that show me what lasyx eye surgery looks like..... & yet.....I can't even find one simple little explanation for something that occurs over 100 trillion times a day.

 

 

 

void Paint(Graphics g){}

 

*sigh sigh Sigh*..... Hi i'm a Graphics object. I was built by a genius who figured out how to display items to the screen... wanna see my source code?

 

I have this method it's called void drawImage(); isn't it cool, I have a javadoc that explains how I work...basically I take an argument from an Image class that I then paint to the screen.

 

 

me: How do you paint to the screen?

 

Graphics: Oh that's easy watch native drawImage(){ //do stuff.... }

 

me: ???

 

Graphics: what I just use my native function to do this...

 

me: Yeah & what's that?

 

Graphics: ummmm.............THATS PRIVATE INFORMATION! HOW DARE YOU REQUEST HOW I DRAW SOMETHING! WHAT ARE YOU A THEIF? YOU TRYING TO STEAL THE WAY I WORK???

 

 

me: geez...no I just wanted to know how you paint...like maybe the bit math, or some type of explanation as to how you work, so I can improve my current graphics code & actually do something of use.

 

 

Graphics: Oh...well I just googled it for ya here's a tutorial on how to paint an image.... first you make an image... Image myimage = Image.createImage("/mypaint.png");

 

ya following? k so then you go

 

g.drawImage(myimage,0,0,g.TOP|g.LEFT);

 

there ya go that's how you paint....

 

 

me: son of a gosh darn **bleep** ugh I give up....i'm sorry to have bothered you all mighty graphics class who does amazing things that nobody will ever help me with....even though I know you're drawing bits that I can manipulate I still have no clue how you work....*sigh* *sigh* *sigh*....

/************** BelowZeroSoft ***********

www.belowzerosoft.com

Using creativity to blow your mind through software 1 step at a time.

*/
Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Java Graphics how many people are on the bus without me?

Not really sure how to respond to that.

 

You pretty much answered your own question, it's proprietary code. There isn't much you can do about it.

 

You (developer) pass Image into function, function takes pixels and passes them into predefined buffer (for screen), buffer gets passed to some assembler function that probably only the hardware maker knows, image magically appears on screen. Most graphics code just passes it to another lower-level function until it hits hardware and then it magically disappears into silicon. Getting the source code to them usually dosn't do much.

 

I needed to see the source code of Graphics2D on JavaSE and all it was, was an abstract class that simply passed data into a function that converted it to a different format in the most obvious way possible and passed it to a lower level function until it hit GDI/OpenGL/DirectX/X/Quartz/etc. and then it vanishes again.

 

BlackBerry's graphics code probably does the same.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Java Graphics how many people are on the bus without me?

Is there a question in this rant somewhere?

 

:smileyhappy:

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Java Graphics how many people are on the bus without me?

At the beginning

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
simon_hain
Posts: 15,956
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Java Graphics how many people are on the bus without me?

all usuable methods are exposed on the interface/jar level.

you can check the  net-rim-api jar.

undocumented methods can change without notice, use them at your own risk.

 

methods not exposed through the API cannot be used, simple as that.

there are internal classes, but only the rim people have the signing keys to enable them. you can peek at some when you step through the code of the mail app or the phone screen (exposed by a listener).

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.