Help using ItemRenderer to show images based on digits in DataGrid model
Hi there,
Disclaimer: this is my very first attempt at Flex!
I found rummaging online, some documentation about
ItemRenderers. I have a datagrid pulling info from a PHP Ajax
backend successfully. One of the columns retrieves a digit only (1,
2, or 3 ).
I've read that I can create a CellRenderer by creating a
mxml file for the renderer (StatusRenderer.mxml), adding this to my
<mx:DataGridColumn specification:
itemRenderer="StatusRenderer"
where my StatusRenderer.mxml right now contains only:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
width="32" height="32">
</mx:Canvas>
It displays a blank square as expected.
so now, how do I make it show images/open.gif,
images/closed.gif or images/deferred.gif based on status, 1, 2, or
3 respectively?
Not sure how actionscript blends into components this way..
Thanks in advance!
Alex
Hi Vikas,
Thanks for sharing.
" [Not sure if one technique has any performance advantages over the other]"It seems to me that in your technique it should be simpler to maintain several gif options – editing LOV seems simpler then editing the DECODE parameters list. I'm also thinking about the option of using dynamic LOV for gifs stored in a table.
Regards,
Arie.
Similar Messages
-
Needing help: using Keylistener to change images
I am trying to using the arrow keys to switch between pictures i have but i cant get it to work... mind that im relativly new at java. Here is what i trying to do:
starts at pic1: press up: frame now has pic2: press down: frame now shows pic1
my code so far:
public class test2 {
static JFrame frame;
static int position = 0;
public static void main(String args[]){
JFrame.setDefaultLookAndFeelDecorated(true);
frame = new JFrame("Frame Title");
JMenuBar menuBar = new JMenuBar();
JMenu menuFile = new JMenu("File");
JMenu menuHelp = new JMenu("Help");
JMenuItem menuFileExit = new JMenuItem("Exit");
JMenuItem menuFilePlay = new JMenuItem("New");
JMenuItem menuFileAbout = new JMenuItem("About");
JMenuItem menuFileHelp = new JMenuItem("Help");
menuFile.add(menuFilePlay);
menuHelp.add(menuFileAbout);
menuHelp.add(menuFileHelp);
menuFile.add(menuFileExit);
menuBar.add(menuFile);
menuBar.add(menuHelp);
frame.setJMenuBar(menuBar);
frame.setSize(1025, 769);
JLabel temp3 = new JLabel(new ImageIcon("EQ2_000000.gif"));
JPanel temp4 = new JPanel();
temp4.add(temp3);
frame.getContentPane().add(temp4);
frame.setVisible(true);
frame.setIconImage(new ImageIcon("bear.gif").getImage());
menuFileExit.addActionListener
new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
menuFileAbout.addActionListener
new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFrame About = new JFrame("About");
About.setSize(200, 200);
About.setIconImage(new ImageIcon("bear.gif").getImage());
JLabel temp = new JLabel(new ImageIcon("bear.gif"));
JPanel temp2 = new JPanel();
temp2.add(temp);
About.setContentPane(temp2);
About.setVisible(true);
menuFileHelp.addActionListener
new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFrame About = new JFrame("Help");
About.setSize(200, 200);
About.setIconImage(new ImageIcon("bearr.gif").getImage());
About.setVisible(true);
frame.addWindowListener
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.addKeyListener
new KeyAdapter() {
public void keyPressed(KeyEvent ke) {
switch (ke.getKeyCode()) {
case KeyEvent.VK_LEFT:
break;
case KeyEvent.VK_RIGHT:
break;
case KeyEvent.VK_UP:
frame.getContentPane().removeAll();
position = position + 1;
JLabel temp7 = new JLabel(new ImageIcon("pics/EQ2_00000" + position + ".gif"));
JPanel temp8 = new JPanel();
temp8.add(temp7);
frame.getContentPane().add(temp8);
System.out.print(" u, " + position );
break;
case KeyEvent.VK_DOWN:
frame.getContentPane().removeAll();
position = position - 1;
JLabel temp5 = new JLabel(new ImageIcon("pics/EQ2_00000" + position + ".gif"));
JPanel temp6 = new JPanel();
temp6.add(temp5);
frame.getContentPane().add(temp6);
System.out.print(" d, " + position);
}import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.*;
import javax.imageio.ImageIO;
import javax.swing.*;
public class KeyControl
BufferedImage[] images;
int imageIndex;
JLabel label;
public KeyControl()
loadImages();
imageIndex = 0;
label = new JLabel(new ImageIcon(images[0]));
//label.requestFocusInWindow();
registerKeys(label);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(label);
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
private void changeImage(int index)
label.setIcon(new ImageIcon(images[index]));
label.repaint();
private Action up = new AbstractAction()
public void actionPerformed(ActionEvent e)
imageIndex = (imageIndex - 1) % images.length;
if(imageIndex < 0)
imageIndex = images.length - 1;
changeImage(imageIndex);
private Action down = new AbstractAction()
public void actionPerformed(ActionEvent e)
imageIndex = (imageIndex + 1) % images.length;
changeImage(imageIndex);
private void registerKeys(JComponent c)
c.getInputMap().put(KeyStroke.getKeyStroke("UP"), "UP");
c.getActionMap().put("UP", up);
c.getInputMap().put(KeyStroke.getKeyStroke("DOWN"), "DOWN");
c.getActionMap().put("DOWN", down);
private void loadImages()
String[] fileNames = { "greathornedowl.jpg", "mtngoat.jpg" };
images = new BufferedImage[fileNames.length];
for(int j = 0; j < images.length; j++)
try
URL url = getClass().getResource("images/" + fileNames[j]);
images[j] = ImageIO.read(url);
catch(MalformedURLException mue)
System.err.println("url: " + mue.getMessage());
catch(IOException ioe)
System.err.println("read: " + ioe.getMessage());
public static void main(String[]args)
new KeyControl();
} -
Display image based on conditions.
Hi every one.
We have to display image (circle) based on three conditions.
Example; if employee is < 1000 small circle, if salary is > 1000 and < 10000 medium size circle and >10000 big size circle.
And second condition if employee location is East coast fill black color in that circle, west coast red color central green color.
Third condition is if employee joining date is less than two years I should display * (Star symbol) in that circle.
I am trying to create conditional format but it is possible to display only one image .
My question is how can I change size and color if the image based on conditions and display start symbol with in the image.
I think I have to create different own images to display for every conditions.
Is there any way to create my report?
Thank you very much for your time and help.Hi,
If you want to display everything in one image for end user you need to do some trick.
sal orginal region orginal Joining date Sal decode value Region decode value Joining date decode value ImageCode
100 east 20\2\2008 1 10 100 111
200 WEST 20\2\2008 1 20 100 121
300 NORTH 20\2\2009 1 30 200 211
300 NORTH 20\2\2008 1 30 100 131
100 east 20\2\2008 1 10 100 111
2000 west 20\2\2009 2 20 200 222
30000 south 20\2\2009 3 40 200 243
Create few more columns in your answers, as following
Salary decode value: based on your original salary decode it to 1 or 2 or 3
region decode value: based on your regions decode it to 10 or 20 or 30 or 40
joining date decode value: based on joining date decode it to 100 or 200
Image code add all of decoded values ie 1+10+100 = 111
In report show image based on image code
i.e from above table row1 image code is 111 (small black circle), last record BigCircle Red with Star.
Pain full thing is you need to create 24 images on your own(3(salary range)*4(regions)*2(join dates) =24) and place all 24 conditions in that column.
--Hope it helped you
Thanks
Srinivas Malyala -
Show images stored in DB in browser
Is is mandatory to use intermidia for showing images stored in DB?
I mean,is it possible to use just PL/SQL to show images uploaded to Oracle 8i. If so, how? Does anyone could send me a sample code?
Thanks in advance and best regards.I have Oracle 8.1.5 and I read that interMedia license is included in DB license.
In this case I am free to use interMedia.
Does interMedia comes with 8.1.5 also?
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by ymizuno():
You can store images as Blobs in the database, without using interMedia. However, if you store images as OrdImage using interMedia with attributes, you can get many advantages of it. interMedia comes with the Oracle database if you have Oracle 8.1.6. Are there any particular reasons why you do not want to use interMedia? <HR></BLOCKQUOTE>
null -
How can I show or hide an image based on screen size in CS6?
I have a web site built using Dreamweaver CS6. I used the fluid grid layout to have different views for each of the 3 types - phone, tablet, desktop. It works well, resizes as it should. I would like to be able to show an image in the desktop version but not the mobile version. How could I do that? I can see in the .css file that different size screens can have their own different settings. Is there code I could add that would hide/show and image based on the users viewport on the same page? Let's say I have a div tag named picture. How could I add a parameter to the picture div tag in the style sheet that would hide the image if it was mobile?
thanks,
MarilynInsert image into a container div.
Desktop CSS:
#divName {
height: xxxpx
width: xxxpx
Tablet & Mobile CSS:
#divName {display:none}
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/ -
Can't show image in the center of the jscrollpane ,any one can help
i write a program to show image in the jscrollpane
i create a class called ImageLabel (it extends jlabel) then i use
ImageLabel im=new ImageLabel(imageicon)
jscrollpane.setViewportView(im);
validate();
repaint();
but it show the image in the left and top corner of the jscrollpane ,not in the center of the jscrollpane
then i change the ImageLabel to JLabel ,:
JLabel im=new JLabel(imageicon);
jscrollpane.setViewportView(im);
validate();
repaint();
it shows the image in the center of the jscrollpane,
but i want to use ImageLabel not jlabel
whats the problem ,any one can help me ,thank you:)the ZoomLabel is the imagelabel ,and my complete code as follows:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
class ZoomLabel extends JLabel
private ImageIcon icImage;
private int ph,pw,picW,picH;
ZoomLabel(ImageIcon ic)
super(ic, JLabel.CENTER);
icImage = ic;
pw = picW = ic.getIconWidth();
ph = picH = ic.getIconHeight();
setSize(pw,ph);
setPreferredSize(new Dimension(pw,ph));
repaint();
validate();
public void zoom(float scale)
ph = Math.round(picH * scale);
pw = Math.round(picW * scale);
setPreferredSize(new Dimension(pw,ph));
repaint();
public void paint(Graphics g)
update(g);
public synchronized void update(Graphics g)
{ g.drawImage(icImage.getImage(),0,0,pw,ph,this);
public class ImageShow extends JFrame
ImageShow()
ImageIcon ii=new ImageIcon("e:/download/pic/me1.JPG");
JScrollPane js=new JScrollPane();
zl=new ZoomLabel(ii);
js.setViewportView(zl);
getContentPane().add(js,"Center");
js.repaint();
js.validate();
pack();
setVisible(true);
public static void main(String[] args)
new ImageShow();
ZoomLabel zl;
} -
Use case for showing records in report view BAM based on version number
Hi,
I have a use case to update records based on version no. Let say I have a table or data object in BAM called 'Notes'. The Notes dataobject has three fields Id, Version, Description. The Notes data is displayed in a BAM report. I need to just display the latest version of the Notes. Say two records with one with Id as '124' and Version '4' and another with Id as '124' and version as '5'. The record related to version 5 should be dispalyed to user. How will I introduce this check in BAM reports for the latest version?
Thanks
Edited by: user5108636 on 28/06/2010 16:47That you see you're prints only means that your method outta called. The code creates a new row, but never inserts the row into the rowset. Then you call execute query which loses any connection to the new route which is not part of the rowset.
First action would never to call insertRow(r1) on the view object.
If you change data this way, only the model layer knows about it, the ui can't know about this (one of the disadvantages of using plsql or this construct you try). You have to tell the view controller to update it's data to. For this you can execute the iterator in the binding layer and/or ppr the container showing your data.
Then I don't see any complicated plsql called do I question if a programmatic co is necessary.
Timo -
Good evening, my name is Ludmila I have a problem. im buy second hand iphone 5 but I can not use the screen shows asking me apple id but I do not know this is my first iphone I do not know what the police thought it was stolen or lost but I you can help me. Someone told me we should stop function Find my iphone but how?? email does not even know the first lord. It cost me 400 euros but may not use iphone. someone laugh at me because I deceived. Please help me tell me his email talk to you should stop off iCloud or ID
Scuzati de engleza google translate
-
<WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart_AppWeb"
runat="server" ListUrl="Lists/MyList" IsIncluded="True"
NoDefaultStyle="TRUE" Title="XsltListView web part" PageType="PAGE_NORMALVIEW"
Default="False" ViewContentTypeId="0x">
</WebPartPages:XsltListViewWebPart>
For any List it work fine but for Image form library its not working:
My url: http://sitename:portname/PublishingImages/Forms/AllItems.aspx
Please provide Solution.
Question:How To show image library with thumbnail view in Visual Webpart using xslt webpart.Is it throwing any error?
do you set correctly the ListUrl parameter? in this case it will be "PublishingImages" -
Using jquery to hide/show field based on query results
I have a form that includes fields for country and state/province. Initially, the state field is hidden. When the user selects a country, I use a bind expression in the state field to get the states in the selected country. I want to display the state field only if the country has states (since some countries don't). Can someone tell me how to do this? Here's the relevant stuff:
<script>
$(document).ready(function() {
$('#stateID').hide();
$('#stateIDLable').hide();
</script>
Country:
<cfselect name="countryID" query="qryCountries" value="countryID" display="country" />
<div id="stateIDLable">State or Province:</div>
<cfselect id="stateID" name="stateID" bind="cfc:geography.getStates({countryID})" />
Thanks.
PeteI presume you have a JavaScript function that handles the results of the cfc binding?
If you don't you will need to incorperate one. Then, as well as populating the second select, this function can use logic to show the second set of controls. -
Help........Show image from database
Hi,
I am stuck at one point. I have to show image stored in the database on the browser. I am able to fetch the image and show it after storing it in one .gif file. But what I want it is : I don't want to store the fetched image in to a .gif file instead I would like to show the image on the fly after fetching it from the database.
The reason I need it this way is...If I store it as .gif before showing, after showing the file the file still will be present in the disk, which after sometime will go beyond the limit.
If at all it is not possible to show it on the fly, then I would like to know if there is any "SESSION ON END" kind of even available in Java so that I can clean up the image when user exits the browser!!!
Please reply as soon as possible.For the first part of your question: If the image is the
only thing you are showing on the browser.. then
you can stream the data (I think I never tried with
gifs)
try {
response.setContentType("image/gif");
ServletOutputStream outf =
response.getOutputStream();
// Print the steamed image data to this
outf
outf.flush();
} catch (Exception e){
System.out.println("Exception Caught"+e.toString());
} -
How to construct a window that shows images in a continuous rotation on a webpage using flash
Would like to know how to create a window in a web page that shows images in a continuous rotation
There are dozens of ways to accomplish this. What sort of experience with Flash do you have? A very simple method is to just place each image on the timeline. Set a frame rate for the movie, and then extend each image's extent on the timeline to allow it to be shown for the duration that you want. For instance, with the frame rate set to 15 fps, to show each image for 1 second, you would have each image occupy 15 frames. Add or subtract frames to suit your needs. You can add transitions between each image if you like.
-
I took 6 panorama shots of a scene and used CC to Photomerge them as one. Couldn't see where to automatic blend the edges and there was 'stitch' lines when the images were merged. So i did the same in Elements 11 and it was perfect. Am i doing something wrong in CC or perhaps not doing something at all?
Any help, please?
DaveHi - Thanks for taking the time to reply and i appreciate the remarks- if a little harsh- we all have to start somewhere and i am fully aware of the limitations of Elements which is why i decided to add CC to my software. I can only say that if an inferior quality software from Adobe does the job well then CC must also be suited to doing the same which is why i can only think, from your comments, that i have not done something simple- however- following tutorials to get to the end result should have sufficed- it didn't so perhaps i will consider posting the difference between the two applications- and, perhaps suffer a few more 'harsh' comments. The learning curve is quite steep and i am a visual learner, but i'm also not totally incompetent:)
Kind Regards
Dave Munn
Original message----
From : [email protected]
Date : 02/02/2015 - 06:45 (GMTST)
To : [email protected]
Subject : why is elements better at photomerge than CC- CC does not appear to automatically fill image based on content but elements does when merging a panorama. Also the stitching is visable in CC but almost perfect in elements- why?
why is elements better at photomerge than CC- CC does not appear to automatically fill image based on content but elements does when merging a panorama. Also the stitching is visable in CC but almost perfect in elements- why?
created by station_two in Photoshop General Discussion - View the full discussion
First a clarification: you are not addressing Adobe here in these user forums. You are requesting help from volunteers users just like you who give their time free of charge. No one has any obligation to answer your questions.
I'll give it my best shot anyway.
Few folks in this forum are really familiar with Elements, for which there's a dedicated, totally separate forum.
Different engineering teams, also.
From this perspective, it will be difficult to give you a direct answer to your "why?" question.
Personally, I blend very large panorama shots in Photoshop proper since I can't even remember when without any issues whatsoever, up to and including in Photoshop CS6 13.0.6.
Without being at your computer and without looking at your images, I couldn't even begin to speculate what you are doing wrong in Photoshop, which I suspect you are. The least you could show is post examples from your panoramas that have gone wrong.
I can tell you that panorama stitching requires significant overlap between the individual shots, besides common-sdense techniques like a very solid tripod and precision heads.
The only version of Elements I have ever used for any significant time was Elements 6 for Windows, which I bought in 2008 to use on a PC (I've been an avid Mac user for 30 years). I found Elements so limited and so bad that I successfully demanded a refund from Adobe. IU mention this only to emphasize that I can truly only address your question from a Photoshop (proper) and Mac user point of view. I couldn't care less about Elements, but if you have comparison examples of panoramas processed in both applications, by all means post those two.
Generally speaking Photoshop is a professional level application that makes no apologies for its very long and steep learning curve, while Photoshop has many hand-holding features for amateurs and beginners.
Perhaps the bottom line is that you should stick with Elements if you personally manage to get better results there.
If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7152397#7152397 and clicking ‘Correct’ below the answer
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7152397#7152397
To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
Start a new discussion in Photoshop General Discussion by email or at Adobe Community
For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624. -
How to show image in matrix by selecting matrix column type as "it_PICTURE"
Hi All!
Can i show image in matrix, by selecting matrix column type as "it_PICTURE". If yes please write the steps.
Thanks & Regards
SurojitHi
First you have to set the matrix column type as it_PICTURE then bind that column to a userdatasource or dbdatasource. In the following code I am using userdatasource . This code will set the picture to a sepecified columns first row. Please create small image and paste it in your c drive (15X15 size image-- "c:\pic.png")
Dim oColumn As SAPbouiCOM.Column
Dim mtxDisp As SAPbouiCOM.Matrix = form.Items.Item("mtxDisp").Specific
form.DataSources.UserDataSources.Add("udsPic", BoDataType.dt_SHORT_TEXT, 254)
oColumn = mtxDisp.Columns.Item("colPic")
oColumn.DataBind.SetBound(True, "", "udsPic")
mtxDisp.AddRow()
mtxDisp.GetLineData(1) '*Loads UserDataSources from line X*'
mtxDisp.DataSources.UserDataSources("udsPic").ValueEx = "c:\pic.png"
mtxDisp.SetLineData(1) '*Sets Matrix line X based on current UserDataSource values*'
Hope this helps
Regards
Arun -
Collecting "similar" images based on appearance??
Can anyone recommend a Mac application that can aid in identifying "similar" images (from a specified group of many images) based on visual appearance??
In the past, I've used Microsoft's Expression Media Pro (formerly iView Media Pro) to assist me in gathering 'like' images which are similar in visual appearance to one another. This proved to be a tremendous aid over the years in situations where I found myself trying to collect images that were 'virtual' duplicates of one another, but could not be collected by so-called 'duplicate finder' apps because they didn't share the same metadata, resource fork, date created/modified, size, name, etc...
_An example of how this might happen:_
- "Open" an image into Photoshop
- "Edit Menu > Duplicate...",
- "Save As" with a different name...
+(in this example, some of the original metadata would be retained, but other identifiable info would be lost).+
_Another example would be if you_
- "Open" an image into Photoshop
- "Select All"
- "Copy"
- "New Document" +(which inherently uses the copied dimensions and resolution on the clipboard from the previous step)+
- "Paste"
- "Flatten"
- "Save As"
Here is a screenshot of Expression Media Pro's "Show Similar" dialog box:
Without going off on too much of a tangent, I've lost complete faith in iView Media Pro (which used to be my Digital Asset Management app of choice) ever since Microsoft bought it and turned it into Expression Media Pro...it's been way too buggy and has become all but unusable for me and my day-to-day needs...
It would be a tremendous help if someone could help me out here by recommending a Mac app to find and gather images based on their appearance...
Thanks!I assume that these images are not inside an iPhoto library? Because all those ‘Save As...’ commands would confuse things a lot in iPhoto.
I’ve not tried this myself but it might help:
http://www.ironicsoftware.com/deep/
Regards
TD
Maybe you are looking for
-
Hi I am doing an Idoc to File. The same Idoc is triggered to two receiving interfaces, which are both File. I copied the message from the Test tab of Message Mapping in IR and pasted in Runtime work Bench , Integratioon Engine test message tab. I ge
-
I just reinstalled iTunes and now I cannot bring up my calendar or contacts in Outlook.
I had to reinstall iTunes on my PC as iTunes would not recognize my iPad. The diagnostics told me to reinstall iTunes which I did and now iTunes does recognize my iPad. But now I cannot access my iCloud contacts or calendar in MS Outlook. How can I s
-
Dock put on display that is not connected
Since I've upgraded to Mountain Lion I have a problem when disconnecting my external display. I use an external Acer monitor with my MBP in a dual-display setup (dock & menu bar on the Acer) when in my office. When I leave the office though, (close
-
hello I use goldengate 11.1.1.1.2 on Aix 6.1 server and oracle database 10.2.0.4, the retention of trail files is one day on the target, when the replicat process abended, I see that, at restart, it reprocess all the trail files , this generate a hug
-
Hi all, How to hide units in the report result display? in BI 7.0 queries. for Ex: im getting a value dispalyed as "4029.12 PC". I need to hide the Units "PC" in the report result. Please guide me in this issue. Thanks in Advance. Regards, Ravi