Highlighter question..
In the below code i am highlighting all the matches in the text document for the search text. I want to keep all these matches and perform another search(find next) on the same search text and this search will find only the next match after the cursor. I want to be able to show the text in a different highlight color this time and once the search next is executed the previous text has to revert back to the previous highlighted color. I tried but yellow is not overrided by the cyan blue. for that matter any color doesnt work. Any help on this one
This is to highlight all the search words in the text.............
public void highlight(JTextComponent textComp, String pattern) {
// First remove all old highlights
removeHighlights(textComp);
try {
Highlighter hilite = textComp.getHighlighter();
javax.swing.text.Document doc = textComp.getDocument();
String text = doc.getText(0, doc.getLength());
int pos = 0;
int matchcnt = 0;
// Search for pattern
while ((pos = text.toLowerCase().indexOf(pattern.toLowerCase(), pos)) >= 0)
// Add highlight around pattern using private painter
hilite.addHighlight(pos, pos+pattern.length(), textyellowPainter);
pos += pattern.length();
if(!pattern.equals("")){
int currentCaretPosition = fullTxtArea.getCaretPosition();
pos = text.toLowerCase().indexOf(pattern.toLowerCase(), currentCaretPosition);
//pos = 1;
if(pos > -1){
fullTxtArea.setCaretPosition(pos+pattern.length());
//found
catch (BadLocationException e) {
private Highlighter.HighlightPainter textyellowPainter = new TextPainter(Color.cyan);
private Highlighter.HighlightPainter textyellowPainter = new TextPainter(Color.yellow);
// A private subclass of the default highlight painter
class TextPainter extends DefaultHighlighter.DefaultHighlightPainter {
public TextPainter(Color color) {
super(color);
this is to search the next matching text.........
try{ fullTxtArea.setCaretPosition(0);
pos = text.toLowerCase().indexOf(pattern.toLowerCase(), currentCaretPosition);
fullTxtArea.setCaretPosition(pos+pattern.length());
if(pos > -1)
Highlighter hilite2 = fullTxtArea.getHighlighter();
Highlighter.Highlight[] hilites = hilite2.getHighlights();
hilite2.addHighlight(pos, pos+pattern.length(), textBlackPainter);
pos += pattern.length();
Any ideas how to make this happen?
You should not only add a new highlight by this
hilite2.addHighlight(pos, pos+pattern.length(),
textBlackPainter);
ut remove the same yellow highlight.
And restore the yellow one when you move to next
match.
regards,
Stasis this what you mean
hilite2.addHighlight(pos, pos+pattern.length(),
textBlackPainter);
hilite2.changeHighlight(pos, pos+pattern.length(),
textYellowPainter);
when executed again i should use the previous position to set the color back to yellow?d
hilite2.addHighlight(prevpos, prevpos+pattern.length(),
textyellowPainter);
Similar Messages
-
Hi all
I know this is kind of picky, and I could get along without it, but does anyone know of a way to highlight text and NOT include the "space after". In other words, highlighting two consecutive lines of text would leave a small white stripe between them?
I know I could set "space after" and "space before" to 0 and add a 10pt. blank line between, but that is particularly irksome in a list.
TIA
JimKOENIG Yvan wrote:
Here is the Mellel's behaviour :
Mellel designers made a choice, Pages ones made an other one.
Both are valid ones.
If you aren't satisfied by the Pages behaviour, you may :
(1) drop Pages.
(2) _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
Then, cross your fingers, and wait _at least_ for iWork'11
I must add that I would be surprised if Apple change the choosen design.
Yvan KOENIG (VALLAURIS, France) jeudi 8 juillet 2010 19:09:28
Thanks! that is exactly what I mean, and I thought that would be the answer (obviously not the one I was looking for). I am trying to drop Mellel as their support has dwindled to almost nothing and their forum has become a ghost town.
I agree with your (somewhat blunt) assessment of the situation and thank you for your time.
I can live with Pages' choice. Just have to get used to it.
Jim -
When a highlighted pdf, highlighted in Acrobat Professional 8.0, is imported into InDesign CS3, the highlighting no longer shows. Is there some way to keep this highlighting? I am on a Mac with OS X Leopard. Thanks.
It's not a completely satisfactory solution, but holding cmd-option while highlighting will allow you to use a marquee highlight tool for text. Unfortunately, the output preserves the line breaks, so you'll be left with having to remove them if you want to paste the passage into your own text.
-
Quick highlighting question...
in numbers is there a way to select a line or row that will highlight the entire row so that you don't confuse the cell in a row with that of a row above or below it? I'm thinking there must be a way of selecting a cell while depressing one key so that the entire row is outlined in red or otherwise highlighted. When you are dealing with long rows it can be rather important.
Hi Brian,
Try this:
Click any cell to activate the table and show the row and column reference tabs.
Click the tab of the row you're working on to select the entire row.
In the Format bar, click the Fill Color well and apply one of the more pastel colours
Carry on with the work in that row.
When done, again select the row, and set the fill colour back to white before moving on.
Regards,
Barry -
Shadow/ Highlight question
Hi there
I am trying to find a answer to this in plain english as I have the Photoshop manual and it is confusing!
Looking at the adjustment Shadow/ Highlight, what should the radius be set to?
I have seen various things on the web but I thought that I would come directly to the source:)
My images that I use the tool on are from a digital camera. Do I look at the pixel dimension of the image? Specific parts of the image?
There must be a logic to this adjustment but I can't seem to grasp it.
Thanks for any help!
JoolsThanks for that.
I think that I need a more technical explanation as to how I obtain the optimum radius.
Someone said to me on another forum that depends on the size of your subject within your image. Does this mean the subject that I want to bring out and use S/H on?
For example, could I:
1) Make a selection round my main subject.
2) Use the measurement log to tell me the pixel size. Or do I look at the mid grey value of pixels?
3) Half this measurment of pixels for my radius?
Or I am talking out of the old proverbial! -
Any one can help the highlighted question pz..thank you!!
Declare
Cursor c_sale is
Select order_line.product_id,quantity, unit_cost,unit_price, client_id, SR_id, order_date From sale
Where product_id = :
CLIENT_TYPE_ID VARCHAR2(10),
PRODUCT_ID VARCHAR2(10),
QUANTITY VARCHAR2(10),
UNIT_COST
UNIT_PRICE
CLIENT_ID
SR_ID
ORDER_DATE NUMBER(5),
Bigin
For c_rec in c_sales loop
Select region_id into r_id
From region where region_name =
(select region_name from dw_op.sales_region@w_link,
Dw_op.sales_rep@w_link where sales_region.region_id =
Sales_rep.region_id and SR_id = c_rec.SR_id);
Select time_seq.nextval into s_time from dual;
(Add statements to extract date components)
Insert into time values (s_time, s_day, s_month, s_year…);
(insert time record)
S_value :=…
(calculate values)
S_cost :=…
INSERT INTO sale VALUES…(Insert record into sale fact table)
End loop;
End;Hi,
>>i am looking for a code to extract date components
Like demonstrated below?
LEGATTI@ORACLE10> alter session set nls_date_format='mm-dd-yyyy hh24:mi:ss';
LEGATTI@ORACLE10> select sysdate from dual;
SYSDATE
04-14-2008 12:58:29
LEGATTI@ORACLE10> select
2 extract(year from sysdate) year
3 ,extract(month from sysdate) month
4 ,extract(day from sysdate) day
5 from dual;
YEAR MONTH DAY
2008 4 14
or
LEGATTI@ORACLE10> select
2 to_char(sysdate,'yyyy') year
3 ,to_char(sysdate,'mm') month
4 ,to_char(sysdate,'dd') day
5 ,to_char(sysdate,'hh24') hour
6 ,to_char(sysdate,'mi') minute
7 ,to_char(sysdate,'ss') second
8 from dual;
YEAR MO DA HO MI SE
2008 04 14 12 58 29Cheers
Legatti -
Highlight/Contour in Photoshop
I love his forum. Everyone is just so knowledgable! Thank you for all your help thus far.
I have a highlighting question. I see that some purchased actions (others have made). For the "highlighting" effect, they have duplicated the copy layer, then changed it to luminosity bending mode, with the layer mask inverted. I just need to brush on wherever I want to highlight.
When I actually tried doing this from start to finish, it doesn't work. I have duplicated the background, and changed it to Luminosity, but NOTHING happened when I brushed it on my subject.
Am I missing something here? Please help!!
Thank you for your time.
hI can't say. You could look at the action step by step and see what it is really doing. Also if the action has come with instructions have a closer look at them.
Since you did purchase them,contact the author or support for advice. I want to help,but I have no idea what they did.
Good Luck.
Gene -
[SOLVED] vim color highlighting not correctly displayed in vc/tty
For instance visual selection is set up to change fg/bg to black/green but changes fg to green. Under x using urxvt it displays correctly.
Last edited by Noble (2010-07-26 21:22:19)I have written my own syntax highlight theme, post below. If you think your script could do anything about it after looking at the file please post But as I said, vim works fine in urxvt, but not when I switch out of X and run it in the vc/tty.
:set statusline=#%n\ %y\ %F\ %r\ %=%c\ %l/%L
:set hlsearch
:set nocompatible
:set noexrc
:set number
:syntax enable
:set autochdir
:set backup
:set backupdir=~/.vim/backup
:set directory=~/.vim/tmp
:set autoindent
:set ruler
:set nowrap
:set nocp
:set scrolloff=5
:set sidescrolloff=5
:set fileformats=unix,dos,mac
:set title
:set laststatus=2
:set tabstop=4
:set autoread
:set showcmd
:set showmatch
:set shiftwidth=4
:set smarttab
:set backspace=indent,eol,start
filetype on
filetype plugin on
filetype indent on
hi clear
set background=dark
if exists("syntax_on")
syntax reset
endif
highlight ErrorMsg ctermfg=red ctermbg=none cterm=bold
highlight WarningMsg ctermfg=red ctermbg=none cterm=bold
highlight VertSplit ctermfg=green ctermbg=black
highlight Folded ctermfg=magenta ctermbg=none
highlight FoldColumn ctermfg=magenta ctermbg=none
highlight FoldColumn ctermfg=magenta
highlight LineNr ctermfg=green cterm=bold
highlight ModeMsg ctermfg=lightgreen cterm=bold
highlight MatchParen ctermfg=black ctermbg=green
highlight Normal ctermfg=white ctermbg=none
highlight SignColumn ctermfg=magenta
highlight NonText ctermfg=blue
highlight Question ctermfg=red cterm=bold
highlight Comment ctermfg=8
highlight Constant ctermfg=green cterm=none
highlight Identifier ctermfg=white cterm=bold
highlight Statement ctermfg=lightgreen cterm=bold
highlight PreProc ctermfg=10
highlight Type ctermfg=2
highlight Special ctermfg=cyan
highlight Error ctermfg=red ctermbg=none
highlight Todo ctermfg=yellow ctermbg=none cterm=bold
highlight StatusLine ctermfg=black ctermbg=green cterm=none
highlight StatusLineNc ctermfg=black ctermbg=lightgreen cterm=none
highlight Directory ctermfg=white
highlight Search ctermfg=black ctermbg=green cterm=none
highlight Visual ctermfg=black ctermbg=lightgreen
highlight WildMenu ctermfg=black ctermbg=cyan cterm=none
highlight Pmenu ctermfg=black ctermbg=green
highlight PmenuSel ctermfg=black ctermbg=lightgreen cterm=none -
Possibly a very basic question but I am going nowhere without a solution. I have set up a spreadsheet in Numbers but it won't give me sums for chosen columns. I have viewed the run through videos and used the formula but nothing happens apart from giving a figure of zero or a red arrow. The sum icon in the bottom left hand section of the window does not highlight or show any total as I understand from the video that you can drag whatever total is here onto the relevent position on your spreadsheet. I have Numbers 09 version 2.3 (554). Can anyone advise. Thanks.
Hi Sohojools,
To sum a column, use a formula such as this one in Cell A6
Type this in a cell below your data:
=SUM(A2:A4) or whatever range of cells you want to sum. The easy way is to type:
=SUM(
and then drag or shift-click to select the range of cells. Close the formula with a final bracket ")".
The sum icon in the bottom left hand section of the window does not highlight or show any total
To see the sum (and other simple statistics) in the bottom left, select a range of cells. That tells Numbers which cells you are refering to.
The videos are good, but the Numbers'09 User guide, and the Formulas and Functions User Guide are better. Download them from the Help Menu in Numbers.
Regards,
Ian. -
Highlighting correct answer after failing question?
Hi,
I'm trialling Captivate 7 and have worked out how to do pretty much everything I need it to do. I have 3 or 4 mini-quizzes scattered through the presentation all of which allow 3 attempts before moving on. What I'd like to do, however, is before moving on, show or highlight the correct answer(s). Is there a way to do that?
ThanksHello and welcome,
Normally this will be done during Review: correct answer indicated (by a checkmark) as well as the given answers. But Review can only happen after the whole quiz has been done, using a button on the Score slide.
It could be done, maybe a bit difficult for a newbie. Question slides do pause (you see the double vertical line in the Slide timeline), and that pause is used twice: playhead remains paused when the user clicks Submit and sees the Feedback captions, then he has to press Y or click on the slide to let the playhead continue. Look at the actions accordion in Quiz Properties panel: both Success and Last Attempt are by default set to 'Continue'.
More information: http://blog.lilybiri.com/question-question-slides-in-captivate and http://blog.lilybiri.com/question-question-slides-part-2
If you understand this work flow, you could time a highlight (box or something else), to start immediately after that pausing point. Since the playhead will continue, that highlight will appear, but be visible only for the duration after the pausing point. If that is not sufficient, you can make the quiz slide longer.
Here I change the duration of the Quiz slide to 5 secs, which means that the Highlight box will be visible for (5 - 1.5) = 3.5secs before the playhead reaches the end of the slide and goes to the next slide -
Highlight on check boxes on question slides
Can I change the default green highlight on the checkboxes on question screens?
ThanksThe easiest way to do it would be to simply not allow the user to click the other 2 checkboxes if the first checkbox is filled.
on checkbox1:
if (this.rawValue == 1){ \\ checkbox is filled
checkbox2.access = "protected";
checkbox3.access = "protected";
if (this.rawValue == 0){ \\ checkbox is unfilled
checkbox2.access = "open";
checkbox3.access = "open";
Then you can simply reverse it for the other 2 that are allowed to be open together, the script would be the same for both checkboxes:
if (this.rawValue == 1){ \\ checkbox is filled
checkbox1.access = "protected";
if (this.rawValue == 0){ \\ checkbox is unfilled
checkbox1.access = "open";
If the user can't click the checkboxes, the hidden forms can't be open. -
I am very new to Macs and iPhoto so this may be an idiot's question, but I have just created my first photo book and want to buy it, but the "buy book" button is not highlighted and when I click it nothing happens. Is there some step I am missing or some connection I need? I am on the internet. Thanks!
I have now recently downloaded 10.0.2 which is confusing in itself, as, as far as I can ascertain that is actually version 11, but I'm not even sure about that.
Version 10.0.2 is the newest version and the successor to GarageBand '11 (version 6.0.5).
The '11 is referring to the iLife '11 suit of multimedia application - the older GarageBand was a part of this bundle.
Have a look at Edgar's graphical enhanced manuals, the explain very detailed how things work and why. You can buy them as iBooks from the iBook store or directly from the page:
http://DingDingMusic.com/Manuals/ -
2 Questions: Black when exporting & highlighted menu items
Newbie here, learning as I go with some very basic knowledge.
Mac OSX 5.8
InD CS 4
Okay, got two questions. My books aren't answering them, my live-help person is busy (InD professional) ... I'm coming here for help.
1. Seems as tho when I draw a 10pt black line, after exporting to .pdf, it is screened. I haven't changed any settings and if something got changed .. I'm clueless. No transparencies, 100% opacity, 100% black. If I print directly from .indd, it is black. Definitely screened when printed out .pdf, and my printing company is the one who noticed it.
2. While I was messing around trying to figure out the black line, all of a sudden, a bunch of my menu pull-down items became highlighted. Again, I'm clueless.
Thanks so much for putting up with a novice.
job1970In Preferences, what is your selection for Appearance of Black? I suggest “Display All Blacks Accurately” and “Output All Blacks Accurately”. I don’t understand Adobe setting these to, effectively, “Display All Blacks Inaccurately” and “Output All Blacks Inaccurately” by default.
You say that the black line is grey, but is it? Can you open it in Acrobat Pro or Illustrator and tell us the actual colour value? I suspect you have the preferences above set to the default, so that process black looks and prints like a rich black. When Acrobat shows it as process black, it appears lighter by comparison.
A new feature in InDesign since version 5 is “Workspaces” which save panel visibility and position and allow some menu items to be hidden and others to be highlighted. I find the menu options distracting an non-intuitive. When you hide a function from the user you don’t make other functions easier to see, you just make those hidden functions unavailable and, for new users, undiscoverable. Similarly, highlighted items are just distracting. You can fix both problems by selecting Window > Workspace > Show Full Menus. -
Two questions on highlighting in Mail...
1. I know how to change the color of the font in an email, but is it possible to highlight a large block of text (like you can w/a PDF or Word)?
2. Along the same lines, is it possible to--on the fly--change the color of an email to blue or grey as it sits in your inbox? I've figured out how to make a rule that does this... For example, "Turn every email from [email protected] to solid blue." But how do I do this for random messages w/out making rules?
Thanks,
David1. I know how to change the color of the font in an
email, but is it possible to highlight a large block
of text (like you can w/a PDF or Word)?
I'm not sure about this one... I'll let someone else give you an answer
2. Along the same lines, is it possible to--on the
fly--change the color of an email to blue or grey as
it sits in your inbox? I've figured out how to make a
rule that does this... For example, "Turn every email
from [email protected] to solid blue." But how do I do this
for random messages w/out making rules?
You should be able to do this with the MailActOn plugin:
http://indev.ca/MailActOn.html
- jim -
Simple Question: How to make a text subpicture highlight not appear by default?
I'm sure I am missing some very easy one-button solution here, but here goes...
I have a menu with just one single button on it. I have the 'Create Text Subpicture' box checked in the button properties panel. What I want is for the highlight to appear only when I roll over the button. But when I preview the menu, the button highlight is on automatically. It functions just fine. I just need to solve this one little highlight issue.
Is it as easy as I am thinking it is?
Thanks!
bobbyHow do I assign rollover states? I've looked but can't find any reference to it.
Thanks!
bobby
Maybe you are looking for
-
What are the best practices in upgrading from mac OS 10.5.8 to Mountain Lion?
I what to upgrade two iMac's from 10.5.8 to Mountain Lion. I have the harddrives backedup. I also have Snow Leopard family pac on disc. I want to know the best way to upgrade and get a clean install of the new OS.
-
Hi all, is it possible to change the charset in the web report, which is added to meta tag? I need to change the way in which the data in tables is shown, not just that tag. Thanks a lot Best regards, Pavel
-
What to do with a 2nd SSD?
My current system SSD barely holds Windows 7 and programs with just 18 GB free. I have another 120 GB SSD sitting around not being used. I'll eventually build another system, but in the meantime wondering if it is a good idea to install it - maybe us
-
How to properly setup photostream across devices
I currently have several apple devices (iPhone, iPad, and Apple TV) and I also use iCloud on my PC, where I have all of my photos as well. The question I have is how do I set up and sync all of my PhotoStream photos so that my entire library will be
-
Hiii I have been part of Creative Cloud for a few months now and I still have not been able to download any applications! Each time I try to, I get the Error Code A12E6. What the heck does that mean!?!?!?!?!?!?!?! Pleeeeease help a sista out! Thanks